What if there's no way to upload a file to a server?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
What if there's no way to upload a file to a server?
Hi,
More than once, the question has been asked how to upload files to a server from a mobile device. An important problem is that sockets aren't supported by default and a bug on Android preventing pictures from being saved to an album or attached to an e-mail. You might use Dropbox or a similar service, but requiring your customers to use an additional service doesn't give a very professional impression.
I have created a very simple LiveCode+PHP library, which uploads small files to a server. It might also work with bigger files, but I haven't tested this yet. This library works on any Android/iOS device and also works on desktop machines with any operating system.
There is no documentation yet and the current version is quite crude. No security has been implemented yet. If you're curious, you might want to have a look. If you need an off-the-shelve solution, then maybe not yet.
The library can be downloaded at http://qery.us/43p after making a donation (or if you made a donation less than 1 year ago). Currently, our server doesn't send e-mails automatically and you may have to wait up to 24 hours to get access to the private downloads.
Kind regards,
Mark
More than once, the question has been asked how to upload files to a server from a mobile device. An important problem is that sockets aren't supported by default and a bug on Android preventing pictures from being saved to an album or attached to an e-mail. You might use Dropbox or a similar service, but requiring your customers to use an additional service doesn't give a very professional impression.
I have created a very simple LiveCode+PHP library, which uploads small files to a server. It might also work with bigger files, but I haven't tested this yet. This library works on any Android/iOS device and also works on desktop machines with any operating system.
There is no documentation yet and the current version is quite crude. No security has been implemented yet. If you're curious, you might want to have a look. If you need an off-the-shelve solution, then maybe not yet.
The library can be downloaded at http://qery.us/43p after making a donation (or if you made a donation less than 1 year ago). Currently, our server doesn't send e-mails automatically and you may have to wait up to 24 hours to get access to the private downloads.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: What if there's no way to upload a file to a server?
Hi Mark,
Have you tested this on larger (~2 MB) files yet?
Thanks,
Simon
Have you tested this on larger (~2 MB) files yet?
Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: What if there's no way to upload a file to a server?
Hi Simon,
I have now tested it with a 600K file. This works fine, although slowly, because I upload small pieces at a time. You can tweak the script, e.g. to upload 256 bytes instead of 64 bytes at a time. If you do this, you may need to change something in your PHP.ini file to allow for longer URL's.
Note that although everything works, the scripts are still in an experimental state. You'll need to spend some time to figure out how it works. I will upload a new version with my test scripts soon.
Kind regards,
Mark
I have now tested it with a 600K file. This works fine, although slowly, because I upload small pieces at a time. You can tweak the script, e.g. to upload 256 bytes instead of 64 bytes at a time. If you do this, you may need to change something in your PHP.ini file to allow for longer URL's.
Note that although everything works, the scripts are still in an experimental state. You'll need to spend some time to figure out how it works. I will upload a new version with my test scripts soon.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: What if there's no way to upload a file to a server?
Hi, Mark - you should use POST instead of GET - you can send far more data that way and avoid the overhead of all those small connections
LiveCode Development & Training : http://splash21.com
Re: What if there's no way to upload a file to a server?
Splash,
I would have used POST if it were possible. Unfortunately, libUrlMultipartFormData doesn't work on Android, so I might as well use GET.
Kind regards,
Mark
I would have used POST if it were possible. Unfortunately, libUrlMultipartFormData doesn't work on Android, so I might as well use GET.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: What if there's no way to upload a file to a server?
It is possible - check out http://forums.runrev.com/viewtopic.php?f=8&t=19144
I've been using it on an android tablet for large uploads.
I've been using it on an android tablet for large uploads.
LiveCode Development & Training : http://splash21.com
Re: What if there's no way to upload a file to a server?
I'll have a look.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode