Page 1 of 1

GET URL problem

Posted: Thu Aug 02, 2012 5:24 pm
by jrioux
get URL "http://www.mydomain.com/directory/anoth ... myText.txt" returns the text from the file I want, beautifully
get URL "http://www.mydomain.com/directory/anotherDirectory/my Text.txt" returns a bad request error,
get URL (urlEncode("http://www.mydomain.com/directory/anotherDirectory/my Text.txt")) returns the urlEncoded string, not the text from the file I want
so, too, with get URL urlEncode("http://www.mydomain.com/directory/anotherDirectory/my Text.txt")

As is often the case with me, there's probably a very simple explanation. I do know that spaces in the path name is part of the problem, but I thought URLencoding it was the solution.

Re: GET URL problem

Posted: Thu Aug 02, 2012 5:40 pm
by Klaus
Bonsoir jrioux,

just replace SPACE with %20 in the url, works fine! :D
...
put "http://www.mydomain.com/directory/anotherDirectory/my Text.txt" into tURL
replace SPACE with "%20" in tURL
get url tURL
...
Or write a little function to do so...


Best

Klaus

Re: GET URL problem

Posted: Thu Aug 02, 2012 5:49 pm
by dave_probertGA6e24
Hi jrioux,

I came across a similar problem with URL before and had to split the call over two lines:

put URLEncode("http://x.com/blah blah.txt") into tURL
put URL tURL into tVar

It seems that the URL command will not evaluate the output from some functions and so dumps the text itself into the variable. Weird.

Cheers,
Dave

Re: GET URL problem

Posted: Thu Aug 02, 2012 5:58 pm
by Klaus
Hi Dave,

this will not work e.g. with the new german UMLAUT urls like:
http://www.müller.de -> http%3A%2F%2Fwww.m%9Fller.de 8)
Best is to only replace SPACE in URLs.

Best

Klaus

Re: GET URL problem

Posted: Thu Aug 02, 2012 6:50 pm
by jrioux
Klaus and Dave,

Many thanks!