need help on imagecreatefromjpeg



Hi, i am trying to resize the uploaded image , but the
imagecreatefromjpeg($sourcefile) doesn't seems to work for jpg file.


when upload jpg/jpeg --notworking
-----------------------------------------------------
<?php
$sourcefile = $_FILES['file']['tmp_name'];

//when echo will show --example: tmp\php119.tmp
echo $sourcefile;


$workingsource = imagecreatefromjpeg($sourcefile);
//show up nothing???????
echo $workingsource;
?>



when upload gif --working
-----------------------------------------------------
<?php
$sourcefile = $_FILES['file']['tmp_name'];

//when echo will show --example: tmp\php119.tmp
echo $sourcefile;


$workingsource = imagecreatefromgif($sourcefile);
//show me the image resource --example: Resource id #6
echo $workingsource;
?>


if you know why is it not working, please tell me..
Thanks in advance!
.



Relevant Pages

  • Possible bug? Strange problem trying to return a value from a function
    ... when the file already exists in the upload directory, ... echo $row." ... throw new Exception ("Unable to move file to upload directory. ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: FTP question
    ... > This is like asking us to guess what is the license plate on your car ... I am building a CMS that needs to upload two supporting files to ... directories on the public server. ... echo "There was a problem while uploading $file\n"; ...
    (comp.lang.php)
  • File upload -- completed but with errors :--)
    ... completed PHP script for file upload. ... echo 'Photo is GIF '; ...
    (comp.lang.php)