CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Load an image component from a Blob field in MySQL Table

Print topic Send  topic

Author Message
udstx

Posts: 10
Posted: 12/04/2008, 11:57 AM

Without having to explain why I am storing an image in a data table, Can sombody explain how to load an image from a data field.
My current BeforeShow code looks like this:
================================================
//Image1_BeforeShow @3-BCE9B184
function Image1_BeforeShow(& $sender)
{
$Image1_BeforeShow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $Image1; //Compatibility
//End Image1_BeforeShow

//Custom Code @4-3EF1CFA1
// -------------------------
$DBtrucks = new clsDBConnection1;
$tmp = "tid = ".CCGetParam("img");
print "Looking up [".$tmp."]\n";
$pic = CCDLookUp("img","images",$tmp,$DBtrucks);
if ($pic){ Print "I looked up an image OK ";}
$Image1->SetValue(CCDLookUp("img","images",$tmp,$DBtrucks));
$DBtrucks->close();


// -------------------------
//End Custom Code

//Close Image1_BeforeShow @3-34B6646C
return $Image1_BeforeShow;
}
//End Close Image1_BeforeShow

==============================================
When it runs, I get the Http error below:
[Thu Dec 04 13:33:40 2008] [error] [client 192.168.1.101] (36)File name too long: access to /\xef\xbf\xbd\x..................

Which looks like it is using the vield value for the file name. I DO NOT want to load from a file, I want to load from an existing variable.
View profile  Send private message
DonP
Posted: 12/04/2008, 12:17 PM

The php.net Web site has some good examples of how to do this but if you
want to see my own code that was gleaned for those and other examples,
please contact me directly (through the Contact form on pc-homepage.com)
and I'll send it to you. It's too large to post here because it has
other bells and whistles in it too, such as embedding watermarks
on-the-fly, etc.

Don (DonP)

udstx wrote:
> Without having to explain why I am storing an image in a data table, Can sombody
> explain how to load an image from a data field.
> My current BeforeShow code looks like this:
> ================================================
> //Image1_BeforeShow @3-BCE9B184
> function Image1_BeforeShow(& $sender)
> {
> $Image1_BeforeShow = true;
> $Component = & $sender;
> $Container = & CCGetParentContainer($sender);
> global $Image1; //Compatibility
> //End Image1_BeforeShow
>
> //Custom Code @4-3EF1CFA1
> // -------------------------
> $DBtrucks = new clsDBConnection1;
> $tmp = "tid = ".CCGetParam("img");
> print "Looking up [".$tmp."]\n";
> $pic = CCDLookUp("img","images",$tmp,$DBtrucks);
> if ($pic){ Print "I looked up an image OK ";}
> $Image1->SetValue(CCDLookUp("img","images",$tmp,$DBtrucks));
> $DBtrucks->close();
>
>
> // -------------------------
> //End Custom Code
>
> //Close Image1_BeforeShow @3-34B6646C
> return $Image1_BeforeShow;
> }
> //End Close Image1_BeforeShow
>
> ==============================================
> When it runs, I get the Http error below:
> [Thu Dec 04 13:33:40 2008] [error] [client 192.168.1.101] (36)File name too
> long: access to /\xef\xbf\xbd\x..................
>
> Which looks like it is using the vield value for the file name. I DO NOT want
> to load from a file, I want to load from an existing variable.
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.