Forum OpenACS Development: Re: Writting a blob to a file and displaying it

Collapse
Posted by Anjani Kumar on
Let me tell you what are the steps that I have done:

1. In the tcl file, I get the portarit in a variable (using db_0or1row).
2. I created a temporary file in /tmp directory (using [open $tmp_file w]).
3. I wrote the portrait to the file (using "puts $fd $portrait") and close the stream (close $fd).
4. Then I use ns_returnfile with the required parameters (ns_write 200 image/jpeg $tmp_file - using fixed mime type for testing).

But it is showing a blank page. Also I put $tmp_file in the SRC attribute of IMG tag in the adp file. Still didn't get the expected output. I have also tried with fpconfig.

waiting for some comments