File transfer question

Creating desktop or client-server database solutions?

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

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

File transfer question

Post by Rob van der Sloot » Wed Apr 05, 2017 4:43 pm

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: 9910
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: File transfer question

Post by Klaus » Wed Apr 05, 2017 5:05 pm

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: 5893
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: File transfer question

Post by FourthWorld » Wed Apr 05, 2017 5:19 pm

What platforms does your app run on? And are these updates over the public Internet, or on an internal network?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

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

Re: File transfer question

Post by Rob van der Sloot » Wed Apr 05, 2017 8:26 pm

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: 9910
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: File transfer question

Post by Klaus » Wed Apr 05, 2017 8:46 pm

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: 1484
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: File transfer question

Post by MaxV » Sun Apr 09, 2017 11:02 am

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: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

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

Re: File transfer question

Post by Rob van der Sloot » Sun May 07, 2017 9:48 am

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

Return to “Databases”