crashmaster Posted November 4, 2008 Share Posted November 4, 2008 Hi there, I have a form with possibility to upload up to 5 fotos. But I have a problem with file extension checking. I dont know how to check file extension before upload. Can anyone help me ? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted November 4, 2008 Share Posted November 4, 2008 This page should help you: http://www.w3schools.com/php/php_file_upload.asp Quote Link to comment Share on other sites More sharing options...
crashmaster Posted November 4, 2008 Author Share Posted November 4, 2008 thx for reply, but I have to check extension by JS/// Also it could be by AJAX (jQuery) Quote Link to comment Share on other sites More sharing options...
F1Fan Posted November 4, 2008 Share Posted November 4, 2008 You could look at the file name, then grab all the characters from the end of the file to the first period. That should give you the extension. Quote Link to comment Share on other sites More sharing options...
xtopolis Posted November 5, 2008 Share Posted November 5, 2008 You should have it check during/after the upload on the PHP side regardless. You cannot trust javascript. There is also the "ACCEPT" attribute for a form, but it is said to be widely ignored by browsers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.