When a file is uploaded to a server, you could have filenames with characters that can cause problems. To clear the filename you can use:
$filename = time().'_'.$_FILES["file"]["name"]; // File name.
$filename = preg_replace('/[[:^print:]]/', '', $filename); // Replace illegal chars
Regards!
No comments:
Post a Comment