Closed Thread
Results 1 to 5 of 5

Thread: please really need help......

  1. #1
    saif0909 is offline Newbie
    Join Date
    Dec 2009
    Posts
    6
    Rep Power
    0

    please really need help......

    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
    Code:
    $img=ImageCreateFromJPEG($filename); 
    Error #2758
    Code:
        $dstW=imagesx($img); 
    Error #2759
    Code:
        $dstH=imagesy($img); 
    Error #2763
    Code:
    imagecopyresized($rimg$img0000$srcW$srcH$dstW$dstH); 
    Error #2764
    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($filename0strpos($filenamestrrchr($filename"/")));
                  
    $twopart=substr($filenamestrpos($filenamestrrchr($filename"/"))+1strlen($filename));
                  
    $smallpath=$smallpath."/small-".$twopart;
                  
    $it=substr($filenamestrlen($filename)-3strlen($filename));
                  if (
    $it=="jpg") {
                    
    $img=ImageCreateFromJPEG($filename);
                     
    $dstW=imagesx($img);
                     
    $dstH=imagesy($img);
                     
    $srcW=100;
                     
    $srcH=100;
                     
    $rimg=imagecreatetruecolor($srcW$srcH);
                     
    imagecopyresized($rimg$img0000$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$img0000$srcW$srcH$dstW$dstH);
                    
    imagegif($rimg$smallpath);
                 }
                  
    //******************************
               


  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Feral is offline Programmer
    Join Date
    Jul 2008
    Posts
    163
    Rep Power
    15

    Re: please really need help......

    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.

  4. #3
    saif0909 is offline Newbie
    Join Date
    Dec 2009
    Posts
    6
    Rep Power
    0

    Re: please really need help......

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

  5. #4
    Feral is offline Programmer
    Join Date
    Jul 2008
    Posts
    163
    Rep Power
    15

    Re: please really need help......

    You would need to post the part of the code that contains that error message.

  6. #5
    saif0909 is offline Newbie
    Join Date
    Dec 2009
    Posts
    6
    Rep Power
    0

    Re: please really need help......

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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts