Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please Help, Uploading Files

    I have a script that is supposed to upload an image to an SQL database, here is the code i used for uploading the image:

    PHP Code:

            $handle 
    fopen($image,'r');
            
    $file_content fread($handle,filesize($image));
            
    fclose($handle);
            
    $encoded chunk_split(base64_encode($file_content)); 
    This code works fine on my own PC but when i use it on my my hosting account, i get the following error:

    Warning: fopen(C:\\Documents and Settings\\sosullivan\\Desktop\\fire.bmp): failed to open stream: No such file or directory in /home/betawebd/public_html/admin/addprojects.php on line 74

    Warning: filesize(): Stat failed for C:\\Documents and Settings\\sosullivan\\Desktop\\fire.bmp (errno=2 - No such file or directory) in /home/betawebd/public_html/admin/addprojects.php on line 75

    Warning: fread(): supplied argument is not a valid stream resource in /home/betawebd/public_html/admin/addprojects.php on line 75

    Warning: fclose(): supplied argument is not a valid stream resource in /home/betawebd/public_html/admin/addprojects.php on line 76

    Ive tried using stripslashes() to make the directory look like this:


    C:\Documents and Settings\sosullivan\Desktop\fire.bmp

    But i still get the same error!!

    Can anyone help me??

    Thanks

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anybody?? Please, this is wrecking my head!!!


  •  

    Posting Permissions

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