Page 1 of 1

how to filter filename in file upload

Posted: Thu Sep 17, 2009 1:37 am
by greedyisg00d
I have a standard format for my filename which is

user1_name_date

for example:

user1_greedy_09202009

Thus when the user browse for a file with a different filename format it will display an error "Invalid filename format". Any idea on how can this be done. Thanks

Re: how to filter filename in file upload

Posted: Thu Sep 17, 2009 2:06 am
by amargharat
you can check file type as follows

Code: Select all

$_FILES["filename"]["type"]

Re: how to filter filename in file upload

Posted: Thu Sep 17, 2009 2:19 am
by greedyisg00d
Thanks but I am referring to the "file name" not the "file extension"