I was wondering if someone here could help me with modifying this PHP
template so that it does something very specific for me. My knowledge
of PHP is very limited (I'm more of a Cold Fusion developer), which is
why I'm inquiring here.
Anyways, first I'll show you the PHP code, and then I'll explain what
kind of modification I need to have applied:
------------------------------------------------------------------------------
<?
include ("config.php");
include("imgprocess.php");
//create a php code that will be evaluated later, each time displaying
the image...
$imgdata =
"\$points=\"$points\";\$colors=\"$colors\";\$penci lwidths=\"$pencilwidths\";";
//...pack it in a compressed archive...
$newgzfile = gzopen($newid.".gz", "w9");
gzwrite($newgzfile, $imgdata);
gzclose($newgzfile);
//...and free some memory.
unset ($imgdata);
//create virtualy the image from the flash compression algorythm;
$image=makeimg();
//create physically the thumbnail from our gd virtual image.
$image2 = ImageCreate($thumbsize,$thumbsize);
imagecopyresized ( $image2 , $image , 0 , 0 , 0 , 0 , $thumbsize
,$thumbsize, 450 ,450 ) ;
if($thumbformat == "jpg"){
Imagejpeg($image2,"temp".$newid.".jpg",$thumbquali ty);
}else{
Imagepng($image2,"temp".$newid.".png");
}
//now lets tell flash every thing is ok
echo "everything=okaisayhellotoyourmama";
?>
------------------------------------------------------------------------------
This PHP file, as best as I can tell, writes a file named "temp.jpg" to
a specific directory on the server (defined in the config.php file).
What I need is to have the template modified so that it "waits" to
make sure that the file named "temp.jpg" DOES NOT EXIST at that
location before attempting to write the file. I've written some Cold
Fusion routines which promptly rename the temp.jpg files and moves them
to a different location, but since this will be used in a multi-user
environment, I have to make sure that temp.jpg never gets overwritten.
I'm not sure if this is even possible to accomplish or not, but I thank
you in advance for whatever assistance you can offer.
Cheers,
- yvan