permission denied for upload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinpkl
    New Member
    • Oct 2008
    • 41

    permission denied for upload

    hi all

    i am uploading an image on live linux hosting server and getting the below error

    Code:
    Warning: move_uploaded_file(../graphics/home_bigad2.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
    
    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpXjKkp7' to '../graphics/home_bigad2.jpg' in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
    This is my php code
    Code:
    <?php require_once("../config.php");
    
    $msg="";
    
    if(isset($_REQUEST['submit']))
    {
    $loc=$_REQUEST['offer_loc'];
    $path=$_FILES['offer_image']['name'];
    move_uploaded_file($_FILES['offer_image']['tmp_name'], "../graphics/" . $_FILES['offer_image']['name']);
    
    
    $qry="insert into special_offers(location,offer_image) values('$loc', '$path')";
    
    if(mysql_query($qry))
    $msg="Offer Inserted successfully";
    else
    $msg="Error Inserting Offer";
    }
    
    ?>
    vineet
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Make sure the folder you're moving to file to has the correct permissions.

    Comment

    • vinpkl
      New Member
      • Oct 2008
      • 41

      #3
      permission

      Originally posted by Markus
      Make sure the folder you're moving to file to has the correct permissions.

      hi markus

      how do i set corect permission. can u say in detail

      vineet

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by vinpkl
        hi markus

        how do i set corect permission. can u say in detail

        vineet
        Do you use an FTP for your site files - if so, what FTP program, or are they stored locally on your computer?

        If they're stored on your computer, you can right-click a folder or file, select properties, and then, from the security tab, change it's permissions. - This is for Windows.

        My FTP allows me to do the same thing; right-click the folder/file I want to edit, then change the permissions from their.

        Comment

        • vinpkl
          New Member
          • Oct 2008
          • 41

          #5
          Permission

          Originally posted by Markus
          Do you use an FTP for your site files - if so, what FTP program, or are they stored locally on your computer?

          If they're stored on your computer, you can right-click a folder or file, select properties, and then, from the security tab, change it's permissions. - This is for Windows.

          My FTP allows me to do the same thing; right-click the folder/file I want to edit, then change the permissions from their.

          hi marcus

          i m using ftp software.

          tell me what to write in permission after right click properties. at present its 755

          vineet

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by vinpkl
            hi marcus

            i m using ftp software.

            tell me what to write in permission after right click properties. at present its 755

            vineet
            Try changing it to 766.

            Comment

            • vinpkl
              New Member
              • Oct 2008
              • 41

              #7
              permission

              Originally posted by Markus
              Try changing it to 766.

              hi markus

              just a question in my mind that

              will changing permission harm my server or website security in any way.

              vineet

              Comment

              Working...