Rockonmetal
08-24-2007, 08:59 PM
I have a file upload input, I wanted to let only certian type of file through...
heres what it looks like
document.write("<br><input type='file' value='' name='FILENAME' id='file'/>")
(The reason why its in document.write is to prevent the user from disabling javascript so he can disable the vaildation process and send fake stuff! because inorder to load the form you have to load the validation... (Smart I know)...
If theres a way you can do this with if statements, I still don't know how, just give me the code and I'll be able to fit it in...
I don't know that much Javascript but I know document.write fucntion. And all you have to check is if the last 4 letters are certain file types *make sure i can put more than one in there*. or if the file contains the file type ending... thanks!
heres what it looks like
document.write("<br><input type='file' value='' name='FILENAME' id='file'/>")
(The reason why its in document.write is to prevent the user from disabling javascript so he can disable the vaildation process and send fake stuff! because inorder to load the form you have to load the validation... (Smart I know)...
If theres a way you can do this with if statements, I still don't know how, just give me the code and I'll be able to fit it in...
I don't know that much Javascript but I know document.write fucntion. And all you have to check is if the last 4 letters are certain file types *make sure i can put more than one in there*. or if the file contains the file type ending... thanks!