File transfer question

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 79
Joined: Sat Apr 17, 2010 9:21 am

File transfer question

Post by Rob van der Sloot »

Is it possible from within LiveCode to copy a file from a server to a pc.
I am updating runtimes regularly.
And put the runtimes on the server of the client.
The users on their pc's need to upload that new runtime.
It would be very userfriendly if by opening the old runtime it would automatically check for updates and then transfer the new runtime to the local folder on the pc.

Thanks
Rob van der Sloot
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: File transfer question

Post by Klaus »

Dag Rob,

is this really a "Database" question? 8)

Anyway, sure this is possible!
Check "load URL" or "liburldownloadtofile" in the dictionary.

Basically one could put a tiny text file on the server with (only) the version number of the EXE on the server in it.
Store the version number into a custom property of your apps.
Then download the small text file, check it against the stored version number and if there is a newer version on the server load that one to a folder on disk.

Hope that helps!


Best & groetjes

Klaus
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: File transfer question

Post by FourthWorld »

What platforms does your app run on? And are these updates over the public Internet, or on an internal network?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 79
Joined: Sat Apr 17, 2010 9:21 am

Re: File transfer question

Post by Rob van der Sloot »

The runtime stack is put on a local windows server and has to transferred to a windows 10 pc.
Its an internal network.
But I think it would be easier to put it on a FTP server.

With load URL, the file is put in the cache, but I want it in a specific folder where other files also are part of the whole system.

I tried this:

load URL "\\f-server\public\mams\Runtime\MAMS1.0\MAN1.0\Management.exe" with message "Done"
but nothing happens
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: File transfer question

Post by Klaus »

Hi Rob,

since you mentoned "server" I immediately presumed you also mean a HTTP server, so "load" or "liburldownloadtofile" may fail in this case. 8)
Try this (and use the forward slash, as Livecode uses this internally on ALL platforms):

Code: Select all

...
put url("binfile://f-server/public/mams/Runtime/MAMS1.0/MAN1.0/Management.exe") into url("binfile:C:/path/to_local/folder/Management.exe")
if the result <> EMPTY then
  answer "Error:" && the result
end if
...
Best

Klaus
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: File transfer question

Post by MaxV »

Code: Select all

put URL (http://www.example.com/myFile.jpg) into URL "binfile:/home/max/Documents/myFIle.jpg"
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 79
Joined: Sat Apr 17, 2010 9:21 am

Re: File transfer question

Post by Rob van der Sloot »

Thanks a lot for the information.
I was a view weeks doing something else, but am back now on this project and with the binfile setup, it works just as I wanted.

All the best
Rob
Post Reply