Simple 'POST' of a file to LC Server

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Simple 'POST' of a file to LC Server

Postby dave.kilroy » Fri Apr 29, 2016 12:53 pm

Hi, last week a friend asked me for examples of uploading a binary file from mobile to LC Server - he had previously been using FTP and now needed to change. I pointed him to probably the best file upload for mobile solution I know of by John Criag viewtopic.php?f=8&t=19144&p=96775&hilit=upload+files+iOS+background&sid=560eb961fb0555e8dc5527f73a0971d2#p96775 - it works everywhere (including mobile) and works in the background.

But my friend needed something much simpler so a few days ago I created a demo stack and LC Server file and was going to send to my friend - but too late he had already got things to work.

So for anyone else out there who needs a simple example of how to POST files to a server that's running LC server please see the attached:

Dave

PostDemo.zip
This zip file contains a .livecode and .lc file
(3.99 KiB) Downloaded 45 times


PS: please come back at me with corrections, suggestions etc
"...this is not the code you are looking for..."
dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 795
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK

Re: Simple 'POST' of a file to LC Server

Postby Lagi Pittas » Thu Jan 12, 2017 4:02 pm

I have to say thank you David (Dave?)

I hate getting the Gorilla as well, when all I want is the Banana.

Works a treat

Regards Lagi
Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 186
Joined: Mon Jun 10, 2013 1:32 pm

Re: Simple 'POST' of a file to LC Server

Postby Martin Koob » Thu Jan 12, 2017 5:32 pm

Thanks Dave, that is great. This one goes into my LiveCode Example stacks folder. (Actually I just had to create a new one today. Couldn't find the one I have. I am sure I have many, each with a few( or just one) Stacks in them.)

Martin
Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 215
Joined: Sun May 27, 2007 8:19 pm

Re: Simple 'POST' of a file to LC Server

Postby Martin Koob » Thu Jan 12, 2017 5:39 pm

I just looked at the sample stacks page on the LiveCode site. I quick search for Post' did not show anything. Perhaps you could submit it there.

http://livecodeshare.runrev.com

Martin
Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 215
Joined: Sun May 27, 2007 8:19 pm

Re: Simple 'POST' of a file to LC Server

Postby Martin Koob » Thu Jan 12, 2017 5:49 pm

Hmmm.... I can't log into http://livecodeshare.runrev.com/login/

I tried my old password and it does not work and there doesn't appear to be any place to reset the password.

Martin
Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 215
Joined: Sun May 27, 2007 8:19 pm

Re: Simple 'POST' of a file to LC Server

Postby dave.kilroy » Thu Jan 12, 2017 6:00 pm

@Martin - no there's nothing on the webpage, but in LiveCode's IDE click on 'Sample Stacks' and from there 'login' (there is also a 'forgot your password' link)

@Lagi - thanks for another banana pun/analogy/story! That's a really nice one involving gorillas :) (I blame bernd for my so-called banana interest)

@both - glad the stack's of use (and yes, so often it's easier to code up something afresh rather than trying to find it amongst my 'snippet-pile') - I've never actually put anything on http://livecodeshare.runrev.com so I might just do it this time!
"...this is not the code you are looking for..."
dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 795
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK


Return to CGIs and the Server

Who is online

Users browsing this forum: No registered users and 1 guest