November 12th, 2002, 01:06 PM
PHP & FTP - whitespaces in filename = ERROR...why?
When I try to upload a file with my php/ftp-script, and the filename contains whitespaces the upload fails....
Any sugguestions for a solution to that?
November 12th, 2002, 01:18 PM
- Replace white spaces with underscores('_')
- Capitalize the first letter of each word
Don't use white spaces in file names, it simplifies life.
November 12th, 2002, 02:12 PM
Have you tried putting the name of the file in quotes?
November 12th, 2002, 02:14 PM
Ok....but the file with whitespaces is on a remote computer and I can`t access that file and rename it. I`ve tried to rename the string that contains the remote filename to a string with "_" instead of whitespaces. Then I put that string into the ftp_put()-function..........but with no luck....
November 12th, 2002, 02:18 PM
Is the remote a *nix type?
Try putting a slash '\' before the space, since spaces in unix filename cause bad things.
There is actually a rename command in ftp, as long as you have sufficient rights to do that.