Welcome Guest Search | Active Topics | Sign In | Register

Mime Type Validation for AJAXUploader Options
Mike Reeder
Posted: Thursday, June 19, 2008 3:50:15 PM
Rank: Newbie
Groups: Member

Joined: 6/17/2008
Posts: 5
Can i validate the Mime Type of the file being uploaded?
eo_support
Posted: Thursday, June 19, 2008 4:03:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Unfortunately no. The uploader can only filter by file extension. But you can implement your own filter mechanism based on this propery:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.AJAXPostedFile.ContentType.html

The key is, unlike filtering by file extension which is done on the client side before any file is transferred to the server, filtering based on ContentType (MIME type) is done on the server side after all files have been transferred to the server. The reason is that user can upload multiple files with different MIME types in a single upload. The server side can not accept part of the request and reject some other part of the request. So all files always get transferred to the server side, once they are all there, you can then decide whether you want to abandon some of them based on the ContentType property.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.