Hi, sorry if this is double posting, but I'm becoming increasingly desperate. I can't get livecode's ftp to work so I'm hoping I can mimic a php file upload submit.
Livecode's post works well when the php isn't a file upload i.e. <form action="my_stuff.php" method="post">
But I need it to replace <form action="my_upload_file.php" method="post" enctype="multipart/form-data">
With php submit forms the first method populates the $_post array, the other (the file upload form) creates a $_post and a $_file array.
I'm very new to php.
Has anyone managed a file upload using livecode's post to a custom php page?
Steve
post to php file upload
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 101
- Joined: Wed Dec 22, 2010 8:17 pm
Re: post to php file upload
Hi well, evidently livecode's ftp does work after all (so relieved), but I am still interested to hear if anyone's uploaded via php.
Steve
Steve
Re: post to php file upload
Hi Steve,
Just use the regular php syntax to retrieve the files from the client.
Post multipart from data from LiveCode.
Kind regards,
Mark
Just use the regular php syntax to retrieve the files from the client.
Post multipart from data from LiveCode.
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
-
- Posts: 101
- Joined: Wed Dec 22, 2010 8:17 pm
Re: post to php file upload
Thanks for replying Mark.
Not quite sure what you mean, but I think it's this:
I use post to send the required info to the submission page where I can retrieve said info from the $_post array and manually set the $_file array?
I probably won't have time to try this for a while but if & when I do I'll report back.
I'm thinking posting to php may have advantages over ftp--with ftp you supply a server password & username, if these were compromised a hacker potentially has access to your site. With a php page you can use a mysql db username & password and the worst that can happen is a hacker can use your php page. (Well, that's a simplification and could even be untrue, but it seems safer to me).
Steve
Not quite sure what you mean, but I think it's this:
I use post to send the required info to the submission page where I can retrieve said info from the $_post array and manually set the $_file array?
I probably won't have time to try this for a while but if & when I do I'll report back.
I'm thinking posting to php may have advantages over ftp--with ftp you supply a server password & username, if these were compromised a hacker potentially has access to your site. With a php page you can use a mysql db username & password and the worst that can happen is a hacker can use your php page. (Well, that's a simplification and could even be untrue, but it seems safer to me).
Steve
Re: post to php file upload
Hi Steve,
Hve you read the PHP example I linked to? It explains it all, except instead of using an HTML form, you use a multi-part POST URL command in LiveCode, with exactly the same variables as in that HTML form.
Kind regards,
Mark
Hve you read the PHP example I linked to? It explains it all, except instead of using an HTML form, you use a multi-part POST URL command in LiveCode, with exactly the same variables as in that HTML form.
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