Thanks for the replies guys!
dalecosp;11048869 wrote:First thing I'd suggest is front-end verification. If you form field has a character limit and you have some JS checking the inputs prior to form submission, it's perhaps less likely to be a problem?
I do have client-side verification for this, as well as file size and extension (there are server-side checks, too, of course).
dalecosp;11048869 wrote:Looks fairly helpful?
It is, and I have something similar. The issue is when you move the file, the destination path has a cap as well - which includes the new file name. My intention is to keep as much of the original file name as possible, mostly for reference so when a potential client uploads 5 files, they can be easily referenced. We are prepending their name and company (if entered) to the file name to avoid overwriting existing files (though I believe my manager moves them every now and then). If neither the name or company is entered, then a Unix timestamp is prepended.
sneakyimp;11048941 wrote:You should be careful using any uploaded file names to store user input. This opens the door for hackers to over-write important files. Keep in mind that when uploading files, each is given a (very short) filename usually something like /tmp/fsfasdfsfsafsf
I am not sure what you mean by "to store user input". The files are stored in a specific folder. I'm not sure how a hacker would be able to overwrite important files. Am I missing something?
sneakyimp;11048941 wrote:Do you really need all the path info provided with the original file?
No, but I have to provide the destination path.
Weedpacket;11048945 wrote:Not to mention uploaders overwriting each others' files by using the same name.
We are prepending their name and company name to the file. If neither are entered then a Unix timestamp is prepended. My manager is not really concerned if there happens to be a file overwritten because so few people use the file upload feature. shrug
In any case, my manager just instructed me to cap it at 100 characters and be done with it, so that is what I have done.