Delivering Files with lcServer ?

Scott Rossi scott at tactilemedia.com
Fri Apr 25 01:21:31 EDT 2014


Hi Peter:

I started setting up a test page to demonstrate, and now I can't get
anything to work, not even my single page test which worked a dozen times
yesterday.  [sigh] Not sure what changed.

At any rate, I've seen PHP examples that involve setting content headers
to facilitate a file transfer, so I figured since lcserver operates
similarly, it should be possible to initiate the download of a zipped file
(or any file).

Any examples out there that someone can point me to?

Thanks & Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 4/24/14 6:17 PM, "Peter W A Wood" <peterwawood at gmail.com> wrote:

>Hi Scott
>
>What is the URL of the iframe? Does it include characters such as "?" or
>"&" ?
>
>Regards
>
>Peter
>
>On 25 Apr 2014, at 08:29, Scott Rossi wrote:
>
>> Hello List:
>> 
>> I'm hoping someone knowledgable about server stuff has a solution to a
>> problem I have delivering a file using lcServer via an iframe.
>> 
>> I'm using lcServer with the following code to trigger a file download:
>> 
>> put url ("binfile:files/sound.zip") into theFile
>> put header "Content-Disposition: attachment; filename=" & quote &
>> "sound.zip" & quote
>> put new header "Content-Type: application/force-download"
>> put new header "Content-Type: application/zip"
>> put new header "Content-Type: application/octet-stream"
>> put new header "Content-Type: application/download"
>> put header "Content-Description: File Transfer"
>> put header "Content-Length:" && the length of theFile
>> put theFile
>> 
>> This appears to work fine from basic web page -- a download is triggered
>> in the browser and the file is written to the drive.
>> 
>> When I run the same code on a page within an iframe, I get the raw file
>> code posted to the iframe. :-(
>> 
>> All pages reside in the same domain (no cross domain issues) so I'm at a
>> loss on how to deal with this.  Any ideas?
>> 
>> Thanks & Regards,
>> 
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX/UI Design
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>>subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list