Uploading Image - Livecode Tutorial Example? Sessions?
johnpatten at me.com
Fri May 26 19:01:09 CEST 2017
It appears to be working for me now, and I did not have to override the version editing the .htaccess file.
What I’d like to do now is keep the script from naming the new image with a random number. :)
> On May 26, 2017, at 9:52 AM, Mike Bonner via use-livecode <use-livecode at lists.runrev.com> wrote:
> Theres another issue with on-rev. Even if you set the sessionSavePath, it
> won't work due to the default version of LC on on-rev. You need to
> override the version using an .htaccess file, but i've not managed to
> actually get that to work for me. Looking for the link that tells you how
> to do this. If you actually get it to work please let me know how!
> Unless they've updated the default version for .lc files, you'll need to
> switch to a more recent version of the server to get sessions to work.
> On Fri, May 26, 2017 at 10:15 AM, JOHN PATTEN via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>> I think I figured out the issue based on an old post by Sturgis…
>> Apparently you have to set the sessionSavePath before you call the “start
>> set the sessionSavePath to the defaultfolder
>> Forum discussion here:
>> 50056&hilit=session#p50034 <http://forums.livecode.com/
>>> On May 26, 2017, at 8:39 AM, JOHN PATTEN via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>>> Thanks for those that answered about the problem I was having with FTP.
>> It was the URLEncode issue that was tripping me up.
>>> However, I’m changing gears as I hadn’t realized that I could not ftp
>> directly into a htmlpublic directory on On-Rev. Ultimately I am trying to
>> just create a little iOS app that will allow me upload and image and create
>> a simple html page to display the image.
>>> I have been using the LiveCode tutorial here: “How do I use LiveCode
>> graphics features server-side?” (http://lessons.livecode.com/
>> m/15262/l/156710-how-do-i-use-livecode-graphics-features-server-side <
>>> I can’t get this to work the “start session” included in the script?
>>> The example starts:
>>> start session
>>> ## enter the image file into our $_SESSION if one's just been uploaded
>>> if $_FILES["imagefile"] is not empty then
>>> put url("binfile:" & $_FILES["imagefile"]["filename"]) into
>>> end if
>>> if $_SESSION["imagedata"] is empty then
>>> printForm ## no image has been uploaded so display the form to
>> upload one
>>> create image “myImage” …
>>> If I take the “start session” out, the server script works, sort of…as I
>> think it will upload the image, but because there is no session, you can’t
>> manipulate the image.
>>> Has anybody got this example to work? I have tried moving the “start
>> session” around to different areas of the server script, but that does not
>> seem to work either.
>>> Thank you!
>>> John Patten
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode