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.
GET URL problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: GET URL problem
Bonsoir jrioux,
just replace SPACE with %20 in the url, works fine!
...
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
just replace SPACE with %20 in the url, works fine!
...
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
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Location: Thailand
- Contact:
Re: GET URL problem
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
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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: GET URL problem
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
Best is to only replace SPACE in URLs.
Best
Klaus
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
Best is to only replace SPACE in URLs.
Best
Klaus
Re: GET URL problem
Klaus and Dave,
Many thanks!
Many thanks!