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 ? Link to comment https://forums.phpfreaks.com/topic/131415-image-check/ 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 Link to comment https://forums.phpfreaks.com/topic/131415-image-check/#findComment-682496 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) Link to comment https://forums.phpfreaks.com/topic/131415-image-check/#findComment-682499 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. Link to comment https://forums.phpfreaks.com/topic/131415-image-check/#findComment-682519 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. Link to comment https://forums.phpfreaks.com/topic/131415-image-check/#findComment-682597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.