This content has been marked as final. Show 9 replies
I have been using one technique in the past. Once you have that binary data, you need to actually stream it to a file and deliver it via cfcontent.
What I usually do is create a template called dynaimage.cfm
In that template I would get the blob, write to a temp file (in binary), then deliver it via cfcontent with delete=yes to clean it up. Or keep it for caching purposes.
Let me know if this helps.
Hi Luis, thank you for your reply. I'm a beginner in coldfusion, and I'm wondering about the details of your solution. I know how to get the blob, but how do I 'write' to a temp file in binary, do I use something like cffile action = write and afterwards, I call that file in cfcontent. Is it possible that you have any sample code?
yep, a simple cffile write, however on the output argument you use:
Then you can use the cfcontent tag.
Thanks Luis, I will work at this.
One note about CFFILE is that it automatically appends a CRLF I believe.
This may render the image unusable by the browser.
> Thanks Luis, I will work at this.
> Thanks again,
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
toll free: 866-319-1573 ext. 245
email: firstname.lastname@example.org <mailto:email@example.com>
blackberry: firstname.lastname@example.org <mailto:email@example.com>
< http://maps.google.com/maps?f=q&hl=en&q=99+atlantic+ave,+toronto&ie=UTF8&z=15&ll=43.640765 ,-79.420767&spn=0.013448,0.04343&om=1&iwloc=addr>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
Hi Don, thank you for your comment, I will keep this in mind,
Hi, I'll probably post this in a new question. I have an additional comment, I am able to get blob from database and display it on form. However, how can I submit this form including my blob to my action page. I tried using a hidden field on my form to hold the blob like so:
<cfset FaceImg = toString(toBinary(FaceImg.BLOB))>
<cfinput type="hidden" name="FaceImg" value="#FaceImg#">
But for some reason, on the action page, it cannot see it.
Thanks so much,
I don't know why you would want to do that? Any specific reason?
Hi Luis, what I want to do is save the binary data to the database. Basically, this is how my program goes: 1. I display image 2. User click's "Save Image" and then my form submits to an action page that saves Image to my personal database. When user is at the form, he or she already has access to the blob so I was just wondering how I can get this blob to the action page so that I can save it to my db?