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

Collapse
Posted by Anjani Kumar on
Well Dave the problem is not with db_write_blob: it works fine. The problem is I dont want to use this procedure as it locks the database handle till the blob data is fetched from the database, this slows the downloads.

Therefore The better solution is after getting the blob from the database, release the handle and then write to a file which can be displayed as an image. This will also work during slow connections. through ns_returnfile

How to do the above is a prob.

Collapse
Posted by Jeff Davis on
I think for portraits it does not matter if you hold the db handle or not, they are not generally large enough to be a real problem. Also you said "I put $tmp_file in the SRC attribute of IMG tag", which will not work since that will send a "GET $tmp_file" which will ask for a non-existent url on your server.

Have you tried checking whether the tmp file is corrupted or not?