Hi, You have almost suggested the solution, what I would like to use assuming that i have a database as well is...
Solution Vision: Create a web service to upload the file. Put it in some shared folder at server and log its path in the database, give it some status for example pending. Make a window service that get the file location from the database and start processing the file change status of file to processing during processing and after process set status to processed. Create a web service to get status of file from the database so that Intranet web site can any time and see status.
Process:
Step1: File Upload Create a web service for the file upload. Make a folder on the server in which you will upload it. After uploading the file rename it to unique id (GUI ID), now store both original name (if needed) and new name (i.e. GUI ID) in a database table and give it status Pending. Following could be the table fields, You can change it according to your preference.
|
|
FileNameNew |
New filename |
FileNameOrignal |
Old file name |
Status |
Current status |
StatusUpdated |
Status last update time |
Step2: File Processing Create a window service that will be checking database for an new files. If new file record found then get file name from the database and you can get shared folder path from the app.config of the window service after adding key and setting it value (e.g. D:\SYS\UPLOADS). Now create a queue in window service and implement threading. You should also set some max parallel threads count so that if more than 10 or 15 files found system not get stuck, you should process a fixed number of files at a time in parallel threads for the system performance concerns.
Step3: Status Report on intranet website Create web service to get status of the file from database and show. More if status is processed the you can show files items as well or what ever your logic is.
Step4: Security/Exception Handling You can use log4net (free logging component) at in web service and window service for exception logging.
Check file for viruses after uploading.
Use web.config of web service to allow authorize users.
Hope this will help.
|