Daniellez
10-09-2009, 08:04 PM
Here's the filename code:
filename=" . htmlentities(rawurlencode($file['filename'])) . "
Is there a way to modify this to deal with spaces in a filename?
Should the spaces be removed when the file is uploaded? Here's the upload code:
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
if($_REQUEST['folder'] != './')
$targetPath = $_SERVER['DOCUMENT_ROOT'] .'/'.$_REQUEST['folder'];
else
$targetPath = $_SERVER['DOCUMENT_ROOT'] .'/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
if(!file_exists($targetPath))
mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo "1";
filename=" . htmlentities(rawurlencode($file['filename'])) . "
Is there a way to modify this to deal with spaces in a filename?
Should the spaces be removed when the file is uploaded? Here's the upload code:
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
if($_REQUEST['folder'] != './')
$targetPath = $_SERVER['DOCUMENT_ROOT'] .'/'.$_REQUEST['folder'];
else
$targetPath = $_SERVER['DOCUMENT_ROOT'] .'/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
if(!file_exists($targetPath))
mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo "1";