Just for information: ReceiveHTTPFile() with space chars

Everything else that doesn't fall into one of the other PB categories.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Just for information: ReceiveHTTPFile() with space chars

Post by merendo »

Well, just in case anyone cares: I just spent about half an hour hunting down a bug which first seemed to prevent me from correctly uploading a file to an FTP server. As it turns out, the upload was fine, the download with ReceiveHTTPFile() was the problem - whenever there was a space character in the filename.

Probably rather obvious, but with the forest and the trees... You know ^^ Simply replacing the space character with %20 will fix the issue - like this:

Code: Select all

ReceiveHTTPFile(ReplaceString(url$, " ", "%20"), destination$)
Maybe this will save someone some searching. Maybe it's even worth a small note in the PB help file.

Cheereo!
The truth is never confined to a single number - especially scientific truth!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Just for information: ReceiveHTTPFile() with space chars

Post by Polo »

You need to encode the URL with URLEncoder :)
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Re: Just for information: ReceiveHTTPFile() with space chars

Post by merendo »

I stand corrected ^^ Time to cut some trees down, eh?
The truth is never confined to a single number - especially scientific truth!
Post Reply