Page 1 of 1

Just for information: ReceiveHTTPFile() with space chars

Posted: Tue Apr 17, 2012 11:47 am
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!

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

Posted: Tue Apr 17, 2012 11:57 am
by Polo
You need to encode the URL with URLEncoder :)

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

Posted: Tue Apr 17, 2012 12:25 pm
by merendo
I stand corrected ^^ Time to cut some trees down, eh?