With TSGetNet, is it possible to just get the "status code" ("200" is good,
"404" it bad, among other things)
Of a file on a webserver, *before* you download it? If it is a 404 you "bail on
the operation", in form the user "Not Found" but if it is 200, continue to
stream it?
Brahmanathaswami
Bell
Date: Sun, 1 Jul 2018 15:19:34 +
From: Sannyasin Brahmanathaswami
To: How LiveCode
Subject: Mastering TS Net
Message-ID:
Content-Type: text/plain; charset="utf-8"
I really need to get my head around TSNet, so began experiments.
This is the documentation for tsNetGetFile
" l
I looked at the lesson. Quite good!
I think one more lesson may be useful.
In my case I will use a "slide show" as a use case.
(But there others, thinking of streaming music playlist)
1) Assume you have the URLs for a slideshow;
2) you fetch this by calling JSON/Text file with the urls for a
Charles: Mysteries
I booted Livecode fresh the morning, and used the same script. But I no longer
get
tResult --tsneterr: ID already in use.
Dictionary script works as expected "File downloaded"
local tHeaders, tResult
on mouseup
tsNetCloseConn "1"
put empty into tResult
@Charles: Thanks, I look into lessons.
But, using the dictionary example
Why do we get the
> # variable watcher
>
> tResult --tsneterr: ID already in use
Even *before* the trace the script? I have break
On mouseup
But it gives this error even before starting the trace?
Hi BR,
There are a series of lessons on tsNet on the LiveCode website:
http://lessons.livecode.com/m/4071/c/235433
If you are looking for an example of how to download something direct to a
file, the lesson called “How to asynchronously download via SFTP directly a
file” should help.
The same
Does TSNet even work with local files? For local files use the read/write
commands or "get/put url".
With a commercial license you shouldn't need to deal with the lower level
functions for internet communication. The basic put, post, and get commands
should do it.
--
Jacqueline Landman Gay |
I really need to get my head around TSNet, so began experiments.
This is the documentation for tsNetGetFile
" local tHeaders, tResult
put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
"ftp://user:p...@ftp.example.com/file.dat";, tHeaders, \
"transferComplete") into tResult
on transferComp