I want my user to be able to select only jpeg images in his hard drive.
Looking only for jpg or jpeg suffixes when he is searching (by default)
???, an interesting way of posing a question. ?
Perhaps you want to use substr(-3,3, $filename) to get the suffic or however it goes...
But really, not sure what the question actually is. 😉
So you're wanting to override the behaviour of the browser's file selection dialogue? Doesn't that depend somewhat on what browser they're using? Certainly it has nothing to do with server-side scripting.
I tried
<input type="file" name="myfile" access="image/gif">
but with no success.
The file dialogue searches for any file by default.
I want to look for a specific file type such as gif or jpg.
Can i do that?
I don't think that's possible. Why don't you just restrict what type of files that your script will process?
if($_FILES['filename']['type'] == "image/jpeg" || $_FILES['filename']['type'] == "image/gif") { //process the upload } else { //do nothing }
yeah, that's an alternative option
thanks