Thanks, Gabriele and Andreas - that put me on the right track.  I came up with 
the following...

    #!/usr/bin/rebol -cs

    REBOL []

    file-name: %test-file.bin
    file: read/binary file-name
    print rejoin [
        "Content-Type: application/octet-stream^/"
        "Content-disposition: inline; filename=" file-name "^/"
        "Content-Length: " length? file "^/"
    ]
    set-modes system/ports/output [binary: yes]
    insert system/ports/output file

-- Carl Read.


On Tuesday, 5-July-2005 at 19:23:13 Andreas Bolka wrote,

>
>
>Carl,
>
>Tuesday, July 5, 2005, 12:01:45 PM, Gabriele wrote:
>
>> On Tuesday, July 5, 2005, 11:39:54 AM, you wrote:
>
>CR>>     print "Content-Type: binary/octet-stream^/"
>
>>   application/octet-stream
>
>CR>>     file: read/binary %path-to-file
>CR>>     print file
>
>> set-modes system/ports/output [binary: yes]
>> insert system/ports/output file
>
>> You  should probably emit Content-Length too, so that the user has
>> a progress bar while downloading.
>
>and if I understood your original question right, and you want that
>the user gets a "real" filename suggested (not the CGI's name), try
>adding the following header:
>
>    Content-disposition: inline; filename=<yourfilenamehere>
>    
>-- 
>Best regards,
> Andreas

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to