Very naive URL question

Mike Bonner bonnmike at gmail.com
Sat May 27 11:32:58 EDT 2017


If you have full reference to the file, and it works in your browser, you
should be able to
put "http://your.domain.com/text.txt"
and have it appear in the msg box
If you use "get" it'll put the page into "it'.  Even if the server returns
an error, it'll end up in "it" so the result being empty is pretty normal I
think. (the only time you might see something there would be for a timeout,
or something of that nature. Someone correct me if I'm wrong)
I suspect its something simple going wrong.  I tested here and: put url "
http://www.google.com" in the message box works fine.

On Sat, May 27, 2017 at 9:17 AM, Graham Samuel via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Thanks Mike - I take your point about having the password etc embedded, so
> I am going for your “http” solution. I had naively thought that “http” was
> exclusively involved in the serving of web pages, and i imagined that a
> simple text file isn’t one of those. Thanks to you, I now know better.
>
> Anyway I have just tried this and find that it works beautifully in my
> browsers (Google Chrome and Safari) - I just use the complete reference to
> the file, and I see the contents of the text file on the screen - but so
> far it doesn’t work in the LC Message Box. I can’t see what I’m doing
> wrong. Again, not only does the text not appear, but there is nothing in
> ‘the result’ either. It’s as if I had not executed the ‘URL’. As an
> experiment, I also tried to download an actual web page (with an extension
> of .html) which I assumed would appear in the Message Box as a long string
> of text. Still nothing.
>
> If I ever get this sorted out, I will also try to find out why Transmit
> puts a different version of the URL onto the clipboard, without ‘www’ and
> repeating the domain name. Could be a bug I suppose - but probably not.
>
> Still puzzled. I must be doing something **really** stupid.
>
> Graham
>
>
> > On 27 May 2017, at 16:30, Mike Bonner via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> > You can embed a username and password in the request, I believe the form
> is
> > ftp://*username*:*password*@hostname/.. this can be dangerous though, so
> > i'm not sure you should necessarily do that.  If you can set up a read
> only
> > ftp account, that might be ok.
> >
> > In this case though, you're placing a file on a web server so it would
> make
> > more sense (and be safer) to just hit the web server itself
> > get URL "http://www.mydomain.com/mytext.txt"  As long as the file is in
> the
> > actual http served hierarchy, it should work fine.  IF you are putting
> the
> > file outside of this hierarchy, then yes ftp must be used.  (I have a
> site
> > and have placed an sqlite database outside the public_html folder just to
> > keep it from being directly accessible0
> >
> > On Sat, May 27, 2017 at 7:57 AM, Graham Samuel via use-livecode <
> > use-livecode at lists.runrev.com> wrote:
> >
> >> Hi - I’m using LC 8.1.4 rc2 Indy on a Mac with Sierra. I am confused
> about
> >> something so fundamental that I am embarrassed to have to ask for help,
> but
> >> there it is…
> >>
> >> I own a website, www.mydomain.com
> >>
> >> Mostly it serves web pages, which works fine. I decided to put a tiny
> text
> >> file onto the server at the same level as the .html pages, say
> myText.txt
> >>
> >> I had no difficulty uploading the file using Transmit, a good FTP client
> >> for the Mac. Now I want to write a statement in LiveCode that gets the
> text
> >> back, so I wrote in the message box:
> >>
> >> get URL “ftp://www.mydomain.com/myText.txt”
> >>
> >> This produced nothing in ‘it’ or in ‘the result’. So it was as if the
> URL
> >> command had never been issued.
> >>
> >> After a lot of fooling around I was told by a browser (Google Chrome)
> that
> >> I should have authenticated this FTP request with a user name and a
> >> password, which I have. My naive question is, how do I tell LC to do the
> >> authentication? I should say that this is entirely internal to the
> program,
> >> so any kind of user-completed dialog is a no-no.
> >>
> >>
> >> TIA
> >>
> >> Graham
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list