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.
|
 |
 |
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/
>
|
|
|
 |
|