I've had this script running on a linux server. Have moved to IIS and get
the following error messages:
Warning: stat failed for /tmp/test (errno=2 - No such file or directory) in
c:\Inetpub\wwwroot\receive_input.php3 on line 40
Warning: fopen("/tmp/test", "r") - No such file or directory in
c:\Inetpub\wwwroot\receive_input.php3 on line 41
Warning: Supplied argument is not a valid File-Handle resource in
c:\Inetpub\wwwroot\receive_input.php3 on line 42
Warning: Supplied argument is not a valid File-Handle resource in
c:\Inetpub\wwwroot\receive_input.php3 on line 43
Warning: Unlink failed (No such file or directory) in
c:\Inetpub\wwwroot\receive_input.php3 on l
Following the advise of a poster here I created c:\tmp and granted
permissions for I_USR_ to the temp directory and also the php directory.
But still no luck.
I'd really, really apreciate some help. Cheers, T
Here's the effected area of my code :
<?
$date_on=date('Y-m-d');
#$date_off="9999-01-01";
$date_off="0000-00-00";
$date_modified=date('Y-m-d');
require('connect.inc');
if($pic!="none"){
// create an image object from the existing Jpeg file
$imIn = ImageCreatefromJpeg($pic);
// get size of original image
$size = GetImageSize($pic);
// calculate size for new image canvas
$ratio = $size[0]/125;
$imOutWidth = 125;
$imOutHeight = round($size[1]/$ratio);
$new_height=$imOutHeight;
// create the blank canvas
$imOut = ImageCreate($imOutWidth, $imOutHeight);
$black = ImageColorAllocate($imOut, 0, 0, 0);
ImageFill($imOut, 10, 10, $black);
// copy the original image to the bigger pallet (centered)
ImageCopyResized($imOut, $imIn, 0, 0, 0,
0,$imOutWidth,$imOutHeight,$size[0],$size[1]);
// output the image to the browser and destroy it
ImageJpeg($imOut, "$pic");
ImageDestroy($imIn);
ImageDestroy($imOut);
$write_dir = "/tmp/";
if($pic){exec ( "mv ".$pic. " '".$write_dir.test. "'");
$file_name = $write_dir.test;
$file_size = filesize ($file_name);
$fp = fopen ($file_name, 'r');
$picdata = addslashes (fread ($fp, $file_size));
fclose ($fp);
$type=$pic_type;
unlink ($file_name);}
}
?>
Cheers,
TJ