Is important to replace empty space or other entities that are in name content of the file(s).
The importance is more relevant when you insert data uploaded in SQL database.
If you want to replace the empty space when you upload a file you can use the next code:
$file_name = $_FILES['userfile']['name'];
$new_file_name=str_replace('_',' ',$file_name )
Also, you can replace all the characters in the name of the files name that are ready to be uploaded:
<?php
move_uploaded_file(
$_FILES["file"]["tmp_name"],
$dir . preg_replace('/[^a-z0-9_\-\.]/i', '_', $_FILES["file"]["name"])
);
?>
|