hi to all i really need help with some img upload errors
please help me.......
the errors are:
Warning: imagecreatefromjpeg(/artist_gallery/Hrido Khan.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/username/public_html/mysite.com/music/admin/audioadmin.php on line 2757
Warning: imagesx(): supplied argument is not a valid Image resource in /home/username/public_html/mysite.com/music/admin/audioadmin.php on line 2758
Warning: imagesy(): supplied argument is not a valid Image resource in /home/username/public_html/mysite.com/music/admin/audioadmin.php on line 2759
Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/username/public_html/mysite.com/music/admin/audioadmin.php on line 2763
Warning: imagejpeg() [function.imagejpeg]: Unable to open '/artist_gallery/small-Hrido Khan.jpg' for writing: No such file or directory in /home/username/public_html/mysite.com/music/admin/audioadmin.php on line 2764
Line#2757, #2764 i was try lot to fix it i thing my directory path its right...but i don't no....
and other 2 error samething can't fixed...please help me
Error #2757
Error #2758Code:$img=ImageCreateFromJPEG($filename);
Error #2759Code:$dstW=imagesx($img);
Error #2763Code:$dstH=imagesy($img);
Error #2764Code:imagecopyresized($rimg, $img, 0, 0, 0, 0, $srcW, $srcH, $dstW, $dstH);
Code:imagejpeg($rimg, $smallpath);
here is the codes
Code:// Save Information?
if( $HTTP_GET_VARS['save'] == 'yes' ) {
$str_upload = trim(basename($HTTP_POST_FILES["userfile"]["name"]));
$UPLOAD_PATH = "/artist_gallery/";
if(@is_uploaded_file($HTTP_POST_FILES["userfile"]["tmp_name"])) {
move_uploaded_file($HTTP_POST_FILES["userfile"]["tmp_name"],ROOT_DIR.$UPLOAD_PATH.$str_upload);
$aid=$HTTP_POST_VARS['aid'];
//mysql_query("INSERT INTO avaiting_artist(id_artist,url,username) VALUES('$aid', 'artist_gallery/avaiting/$str_upload','{$_SESSION[username]}')");
//******************************
$filename=$UPLOAD_PATH.$str_upload;
$smallpath=substr($filename, 0, strpos($filename, strrchr($filename, "/")));
$twopart=substr($filename, strpos($filename, strrchr($filename, "/"))+1, strlen($filename));
$smallpath=$smallpath."/small-".$twopart;
$it=substr($filename, strlen($filename)-3, strlen($filename));
if ($it=="jpg") {
$img=ImageCreateFromJPEG($filename);
$dstW=imagesx($img);
$dstH=imagesy($img);
$srcW=100;
$srcH=100;
$rimg=imagecreatetruecolor($srcW, $srcH);
imagecopyresized($rimg, $img, 0, 0, 0, 0, $srcW, $srcH, $dstW, $dstH);
imagejpeg($rimg, $smallpath);
}
if ($it=="gif") {
$img=ImageCreateFromGIF($filename);
$dstW=imagesx($img);
$dstH=imagesy($img);
$srcW=100;
$srcH=100;
$rimg=imagecreatetruecolor($srcW, $srcH);
imagecopyresized($rimg, $img, 0, 0, 0, 0, $srcW, $srcH, $dstW, $dstH);
imagegif($rimg, $smallpath);
}
//******************************
}
1.) check to make sure that move_uploaded_file is actually moving the file.
2.) if move_uploaded_file returns true then trying adding ROOT_DIR to $filename OR simply use file_exists to check if the file is there before tying to use it.
hey...i think its work...but no error come just say Warning: We were unable to create a new Album.
can u tell me why please?........
You would need to post the part of the code that contains that error message.
hello sir, i was try to post cods but its give me error message unable to post when i try to post
because i have to mush link in there...
so please give a way to post that codes.........
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks