Jump to content

Upload file without white space in the name


maxat

Recommended Posts

Hi

I need help in my upload form, I don't know how to remove white space between two words if file name consist of two words.

 

What should I put in the script below to remove the space?

 


if (isset($_POST['btnAdd'])) {
$uploaddir = 'certificates/';
$uploadfile = $uploaddir . $_FILES['file']['name']; 

if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) 
{ 
$temp = explode('/', $_FILES['file']['name']);

$certificate = 'certificates/' . urlencode(end($temp));
} 
else 
{ 
$certificate = '';

} 







Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.