views:

426

answers:

4

Requirements:

  1. On a web page in our web application, we have a requirement to upload a file. The file is most likely to be a pdf (pdf file has form fields filled in by users), or scanned jpeg/tiff/gif files in zipped format where user has scanned the form.
  2. The size of the file is likely to be be 3-7Mb.
  3. The file will be stored in as BLOD in the Oracle Database

System Information:

  1. Windows Server 2003
  2. IIS 6.0
  3. ASP.Net/C# 3.5 with Ajax Control Toolkit

Questions:

  1. Is there an AJAX control readily available to handle file upload of this type. The control being AJAX is preferred, but a non-AJAX would do.
  2. Are there any .Net components available for checking file validity. Our check will be mainly for pdf. Optionally we may want to allow jpeg/tiff/gif/png - any components to check these file types?
  3. From the security perspective, are there any Anti-Virus components that can be invoked from .Net code to check the file for virus?

Anyone worked on a similar functionality can please share their experience?

Thanks in advance

-Moiz

+3  A: 

1) Have a look at http://www.uploadify.com/

2) The above component has file size/extension tests

3) You should install anti-virus on your web server.

Mark Redman
A: 

http://swfupload.org/ is a Flash-based, asynchronous file upload component that is very easy to implement and integrate with ASP.Net (since the uploaded file comes through in the Request.Files[] collection).

It supplies client side file size and extension tests as well. You'll want to still validate file extensions and such on the server since the validations are handled JavaScript properties and may be circumvented (haven't seen any JavaScript related upload tool that can't be bypassed).

Some anti-virus vendors provide an API to scan memory or a specific file; however, I've seen a number of places drop the file into a directory that's constantly monitored and handled using that type of scanning instead of through the api.

JamesEggers
A: 

take a look at http://ajaxuploader.com/ also consider Silverlight solutions, like http://www.codeplex.com/SilverlightFileUpld Flash based uploaders (like YUI2 Uploader, http://developer.yahoo.com/yui/uploader/) have some limitations comparing to Silverlight due to raised security in recent versions of Flash. For example you can not pop up file selection dialog from client JavaScript.

Konstantin Salavatov
A: 

The ASP.Net AJAX toolkit now has an Async File Upload control

This control was released after we had already implemented our requirement in production (without async file upload).

Moiz Tankiwala