On Thu, Aug 25, 2011 at 2:33 PM, McClure, Timothy J UTCFS <
tim.mccl...@fs.utc.com> wrote:

>  The following code does not work.  I have it stored in an lp file.****
>
> ** **
>
> #!/usr/bin/env cgilua.cgi****
>
> <% ****
>
> local f = io.open ("/usr/share/mini-httpd/html/cgi-bin/lockingplan.txt",
> "rb")****
>
> local content = f:read("*a")****
>
> f:close()****
>
> cgilua.print('HTTP/1.1 200 OK')****
>
> cgilua.print('Content-Type="application/text"')****
>
> cgilua.print('Content-disposition= "attachment; filename=lockingplan.txt"')
> ****
>
> cgilua.print('Content-Length=' .. #content)****
>
> cgilua.print(content)****
>
> %>****
>
> ** **
>
> The output displayed is the following:****
>
> HTTP/1.1 200 OK Content-Type="application/text" Content-disposition=
> "attachment; filename=lockingplan.txt" Content-Length=9 testing****
>
> ** **
>
> I want a “save as” prompt to save the file.  Can anyone tell me what I am
> doing wrong?****
>
> ** **
>
> Thanks****
>
>
The processor for .lp files probably send Content-type: text/html already.

You can try renaming your file to .lua to see if it works.

-- 
Luís Eduardo Jason Santos
_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to