If your PDF has binary content in it, then ns_return won't work with it. If you don't want to write to a file and ns_returnfile, then you might try ginning up a response with ns_write, which handles binary data OK

Rusty

Ian Harding wrote:
Hello,

I know this is an easy question, I am just not finding the answer right now.

I create a pdf in memory.  I know it's good, because I write it out to
the filesystem to check it for debugging.  The proc that creates it
returns it to the caller then the caller sends it back to the client.
Like this:

set data [cart::print $cart_id $printer_id 0]
if {[string length $data]} {
       ns_set put [ns_conn outputheaders] Content-Disposition:
"attachment; filename=\"downloaded.pdf\""
       ns_return 200 "application/pdf" $data
}

The resulting pdf is corrupted.

I assume something in the tcl procs handing the results back and forth
is what's doing it.  I don't want to write to the filesystem, or
return directly from cart::print.  Is there a way to do this?  Should
I park the data in an nsv or something?

Thanks!!

- Ian


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to