Use the http form upload the file to the server.
approach 1
1)I want to use the original file name as the new name if the file name is valid, meaning "alphanumeric, - or _".
2) But if the original name has spaces, I will get rid off the spaces in the new name.
3 If the new name has other characters other than "alphanumeric, - or _", then the name is not valid. file upload will fail.
approach 2
1) I want to use the original file name as the new name if the file name is valid, meaning "alphanumeric, - or _".
2) if the orginal file name has any characters including space other than "alphanumeric, - or _", get rid off them in the new name
First question:
Which approach you will use? Approach 2 will have less failure to upload due to we auto correct the invalid names, but it could create conflict of two files after the name cleanned up, they may have the same new name.
Second question:
I don't need the full scripts. Could you give me the scripts for these key steps for both approaches? Specially approach 2 step 2).
Thanks a lot.