FileSystemWatcher in Web Application

  • Thread starter Thread starter Sacha Korell
  • Start date Start date
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
 
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!
 
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
 
Back
Top