in reply to File upload and directory permissions
Also, the regexp should constrain filenames to safe characters (something like =~/^.*?(a-zA-Z0-9.+)$/ will work - the current one won't strip MacOS paths (Volume:Folder:File), and will pass various things that could, depending on filesystem and what you use to view the directory, range from mildly annoying to security risks.)
And open(FILE,">filename"); will follow symlinks and overwrite existing files. sysopen() with O_CREAT|O_EXCL (and O_NOFOLLOW if your OS supports/needs it) is safer.
|
|---|