The upload form I am working on for my company's new quote request page allows files to be uploaded. One thing I had not considered was file name and path length. Are there some best practices to handle these? Also unfortunately I am developing the site on a WAMP stack but the live server is Unix, so things are not identical in both environments.
We're not really concerned about it since very few people actually upload anything and when someone does it's always some reasonable length, but of course we'd like to be prudent and make sure everything is accounted for.
Currently I am checking if the file name is longer than 255 characters and just truncating it (while keeping the extension intact), but this doesn't work since move_upload_file() uses the full file path when creating the new file - which is longer than 255 characters. So it seems like you have to know the full length of the path + file name and deal with that - except that means the file name length can't truly use all 255 characters. Any best practices regarding this? My online searching just comes up with results about checking if a file name equals something specific or a specific extension.
Thanks!