Activity Stream
48,167 MEMBERS
65287 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member

    Default php remote upload code fix needed :)

    Hey,
    I used this code for remote upload of pics

    Downloading of pics from remote server to my image host.

    My Image Host :
    Code: 
    www.imgair.net
    The Script is here :
    Code: 
    http://imgair.net/remote.php
    It returns a HTTP Error 500 (Internal Server Error), while all the other pages on the same server load perfectly (htm, html and php pages)

    Code: 
    <?php 
    function remoteUpload($url) 
    { 
       $newfname = "images/".str_replace('%20',' ',basename($url)); 
       $file = @fopen ($url, "rb"); 
       if($file) 
       { 
          $newf = fopen ($newfname, "wb"); 
          if ($newf) 
          { 
             while(!feof($file)) 
             { 
                fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 ); 
             } 
             if ($file) 
                fclose($file); 
    
             if ($newf) 
                fclose($newf); 
    
             chmod($newfname,0755); 
             if(file_exists($newfname)) 
             { 
                //add the image to your database 
                //print the path of the image 
             } 
             else 
                error('There was an error uploading that image.'); 
          } 
          else 
             error("We're sorry, but there was a problem uploading that image. It probably has an incorrect extension."); 
          } 
       } 
    } 
    ?>
    if any one helps me out with this, i will surely put your name in the credits page on my site..

    also , i wanted to know if the script displays the image link that has been uploaded.

    Please help me out with this

    Thanks,
    SpeedBus
    speedbus Reviewed by speedbus on . php remote upload code fix needed :) Hey, I used this code for remote upload of pics Downloading of pics from remote server to my image host. My Image Host : www.imgair.net The Script is here : http://imgair.net/remote.php Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    When you get that 500 error normally a error log is created in the folder it is run or in the root folder.

    Check and see if there is one to give us more information.

  4.     
    #3
    Member
    Thanks for the reply.. but i dont see any log file.. is the script proper ?

  5.     
    #4
    Respected Member
    Looks like you have fixed the problem Nice work.

  6.     
    #5
    Member
    Yup.. Just got it fixed about 4 hours ago Thanks now i just gotta hope that my site gets famous !

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 28th Apr 2011, 12:28 PM
  2. Replies: 10
    Last Post: 27th Mar 2011, 05:06 AM
  3. i need filesonic php upload code
    By chems in forum Web Development Area
    Replies: 26
    Last Post: 20th Feb 2011, 07:28 PM
  4. Replies: 7
    Last Post: 11th Jun 2010, 04:41 AM
  5. Image Upload in php. Code snippet #2
    By SplitIce in forum Tutorials and Guides
    Replies: 5
    Last Post: 31st Oct 2009, 07:40 AM

Tags for this Thread

BE SOCIAL