• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to submit a blob with my form...

New Here ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Hi, I get a image 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,
C
TOPICS
Advanced techniques

Views

788

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

After you run this:
<cfset FaceImg = toString(toBinary(FaceImg.BLOB))>

If you run this:
<cfdump var = "#FaceImg#">

what do you see?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Hi Dan, I see a lot of characters. Now, I see the variable being passed to my action page, but the problem is that it seems to only have a shorted portion of the variable, seems that some of the content got cut off.

Thanks,
C

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

I wonder if you may be running into some kind of field or form length
restriction, which could be in the browser, web server or application
server.

But I have been unable to find any readily available information on this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Assuming you actually succeed, what are you going to do with this variable on your action page? If the intent is to display the image again, there are probably better ways to do it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Ok a little more research has turned up this info for IIS.

POST data is limited to 2 MB on IIS 4.0, and 128 KB on IIS 5.0. Each
name/value is limited to 1024 characters, as imposed by the SGML spec.
Of course this does not apply to files uploaded using
enctype='multipart/form-data'

See KB #260694 [ http://support.microsoft.com/default.aspx/kb/260694 to
learn how to adjust the limits of POST data (this deals with
adding/modifying MaxClientRequestBuffer in the registry).

In IIS 6.0 (Windows Server 2003), you can adjust this setting in the
metabase. You need to increase the setting for
AspMaxRequestEntityAllowed to allow larger files to be handled by the
Request object. Look for this setting in metabase.xml; the default is
204,800 (200 kb), but you can change it to reflect your expected usage.
You will need to restart IIS for this change to take place, unless
"enable direct metabase edit" is enabled.

I would suspect there are similar concerns with other web servers. And
as earlier mentioned, browser limits may play into this as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Hi Dan, 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?

Thanks,
C

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2006 Dec 22, 2006

Copy link to clipboard

Copied

Your original post start with, "Hi, I get a image blob from database". So you already have it.

Then you say, "what I want to do is save the binary data to the database".

How does your desired end result differ from what you have to start with?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2006 Dec 23, 2006

Copy link to clipboard

Copied

It might be shorter doing it the longer way, like this

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 26, 2006 Dec 26, 2006

Copy link to clipboard

Copied

LATEST

Hi Dan, Ian, and BKBK, thank you so much for your reply's, what a learning experience this is, I'm really enjoying working with Coldfusion, I have to absorb your replies and reply back if I get any issues.

Thanks again for your awesome help!

C.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation