Click to See Complete Forum and Search --> : PHP Upload not working with spaces in filename?


sanchez_1960
10-02-2007, 07:18 AM
I've got two servers, one works fine with spaces within the file upload. However, the other doesn't?

What could this be?

callumd
10-02-2007, 07:54 AM
This is an absolute guess..

Is it the operating system?

I know I had some trouble with some file names because one operating system on one server (I think it was Linux) was case sensitive, while Windows wasn't.

So the file:

pic1.PNG

Was not recognised on the Linux server if I referred to it as 'pic1.png', but Windows recognised it fine.

gizmo
10-02-2007, 01:44 PM
Windows will accept spaces in filenames, Linux requires %20 instead.

sanchez_1960
10-03-2007, 04:12 AM
Yep, both servers are running Linux but one will accept spaces while the other wont.

MrCoder
10-03-2007, 05:23 AM
One server running with safe_mode on and the other without?

NightShift58
10-03-2007, 07:13 AM
Check your server settings...

I suspect one is automatically converting spaces to %20 while the other hasn't been told to do so...

You can use urlencode() to force the conversion, regardless of server settings.

\\.\
10-03-2007, 08:33 AM
Depends on the server, usually Apache server truncates at first white space, so ensuring that your white space is treated correctly in the first place will prevent this from happening.

As NightShift has suggested, urlencode whatever is causing the issue.