FileSystemWatcher in Web Application

S

Sacha Korell

I need to set up a FileSystemWatcher in my web application (to automatically
process uploaded files) and I'm trying to decide where to set it up. I would
like to keep it within the web app, but it needs to watch a certain folder
even when nobody is making a request. I could instatiate the
FileSystemWatcher in the Application_Start event, but what happens when
somebody restarts the server? I guess in that case the FileSystemWatcher
wouldn't work until the next person makes a request, right?

Would it be best to create a Windows Service that creates the
FileSystemWatcher and runs the appropriate code to process uploaded files?
In this case, if the web application gets moved to a different server,
someone would have to remember to install the Windows Service on that new
server.

Any suggestions would be greatly appreciated!

Thanks,

Sacha
 
H

Hernan Ochoa

Do you need to process the uploads offline and/or asynchronously? I guess
you want to do this
for performance reasons, right?

IMHO, using the service is a good idea.

bye!
 
S

Sacha Korell

Well, requisitions get FTP'ed to a certain folder in the form of delimited
text files, and our application simply grabs these files, parses them for
data and dumps the data into a database. That's basically it. I had hoped to
somehow be able to keep this functionality with the web app, but if I create
a Windows Service, it would be a separate application.

Sacha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top