...

View Full Version : how to filter the file extensions in the file upload type?



mds8000
08-07-2007, 04:55 PM
hi all,
how to filter the file extensions in the file upload type? i've used "accept" attribute of the input element as accept="image/jpeg,image/gif". but no use......
i want to upload image files to the server. how to implement this?help me......

CFMaBiSmAd
08-07-2007, 05:23 PM
Just because a browser "supports" a tag, does not mean that it actually uses it. Here is a web page that indicates that current browsers support the "accept" tag, but don't do anything with it because they don't have to - http://www.webdevout.net/browser-support-html

If you want to check file extensions, you can do this using javascript before the form uploads the file. Here is a link I found through searching the Internet - http://willmaster.com/blog/javascript/prevent_upload_illegal_file_extensions.html

mds8000
08-07-2007, 07:29 PM
thanx frnd,
it is working. but i need, value of the file type should be cleared when user chooses wrong file(other than images)..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum