Web developer from Sydney Australia. Currently using asp.net, mvc where possible.

Tuesday, November 6, 2007

Emailing: An alternate file upload method

On a recent project there was a requirement for an easy upload method for files. We considered a few options such as drag and drop file upload components, ftp , file synchronization etc. However since the files arrived via email the simplest method (for the user) was to have the email and attachment forwarded onto a specified email address.

When an email is delivered to the address, the asp.net website picks up the email and saves any attachments into a POP email inbox folder on the server. Then emails are then sorted and the attachments are moved to the required directory based on the business rules of the system.

This is the first time I have used such an approached and has been a great success in terms of ease of use. The client is very familiar with forwarding emails and the process has become second nature.

There are a few draw backs to be aware of when using this process, mainly concerning the slow nature of the POP mail servers in use. The mail takes a about 3 to 5 minutes to arrive on the site in the correct location. This is having the web site check the emails every minute.

Technically we had to ensure that there is only 1 web client checking the email at once. In testing, we had many emails delivered, which causes the download of the email to take longer the 1 minute. After which another client started and because the email client would delete the email after downloading the contents this caused major problems. The solution was to stop the secondary clients launching if a client was already running.

Apart from the above the solution is up and running well. It's definitely something to keep in mind next time you have to deal with file uploads to a website

1 comment:

Unknown said...

your post is very nice, I really like your post...

Mechanical Seals