chmod to 777 but still get permission denied on image upload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    #1

    chmod to 777 but still get permission denied on image upload

    I've been using the following function (yes, it is inelegant, what can
    I say, I wrote it a long time ago) to upload images. Haven't had a
    problem with it for at least a year, and I don't recall changing it
    anytime recently. Nevertheless, the script is suddenly dying on this
    line:

    if (copy($uploaded File, $pathToImageFol der)){


    This is the error I get:

    Warning: Unable to access in
    /home/www/krubner/atp/mcIncludes/mcImages.php on line 199


    My first thought was to check permissions - they were set to 755, but
    to test if they were the problem I changed them to 777. Tried again
    and got the same problem. So then I added in the line, you'll see it
    below, where I try to echo out the values. This is what I get:

    here's the file name and here's the folder
    /home/krubner/www/atp/mcImages/


    There is no file name. I assume that is the problem, but why is there
    suddenly no file name? (I'm running version 4.2.3 of PHP, if you're
    asking).



    function uploadImage() {
    extract($config = getConfig());
    global $forms, $io, $users, $links, $sql, $uploadedFile,
    $uploadedFile_s ize, $uploadedFile_n ame, $overRide;
    $uploadedFile_n ame = processFileName ($uploadedFile_ name);
    $uploadedFile_n ame = htmlspecialchar s($uploadedFile _name);
    if ($uploadedFile_ size > 10000000 && $overRide != "true") {
    startPage("This image is very large, over 10 megabyte. Are you sure
    you want to proceed?");
    echo "
    <div class='dvclMcWh oleForm'>

    <form method='post' action='$self' enctype='multip art/form-data'
    class='mcForm'>
    Upload this image: <br>
    <input type='file' name='uploadedF ile'><br><br>
    <input type='hidden' name='choiceMad e' value='uploadIm age'>
    <input type='hidden' name='overRide' value='true'>
    <input type='submit' value='Upload File'>
    </form>
    </div>
    ";
    endPage();
    } else {
    $pathToImageFol der .= $uploadedFile_n ame;
    $imagesFolder .= $uploadedFile_n ame;
    echo "<br><br><br><b r> here's the file name $uploadedFile_n ame and
    here's the folder $pathToImageFol der ";

    if (copy($uploaded File, $pathToImageFol der)) {

    startPage();
    echo "
    <div class='mcForm'>
    The image or file has been uploaded. If you wish to reference it
    this is the address:<br><br >
    <a href='$imagesFo lder'>
    $imagesFolder
    </a>
    <BR><BR>
    The code for a link to this image would look like this:<br><br>
    &lt;img src='$imagesFol der'&gt;
    <br><br>
    Put this code on any page where you want this image to appear:
    <br><br>
    <img src='$imagesFol der'>
    <br><br>
    The ALT tag controls what text appears when the mouse cursor hovers
    over an image. If you type &lt;img src='myImage.jp g'
    ALT='Photo taken in downtown Charlottesville '&gt; then the words
    'Photo taken in downtown Charlottesville ' are what appear.
    <a href='http://www.htmlhelp.co m/reference/wilbur/syntax.html'>Yo u
    can read more about IMG tag syntax on htmlHelp.com</a>
    <br><br>
    Also note that if you want an image to float in the middle of a
    column, just put the tag &lt;center&g t; before it and the tag
    &lt;/center&gt; after it. (Hopefully all this code writing will be
    automated in future versions of this software; for now,
    sorry folks, but you've got to hand edit these tags if you want
    them any different than how they are listed below.)
    </div>
    ";
    endPage();
    } else {
    global $forms, $io, $users, $links, $sql, $users;

    startPage();
    echo "
    <div class='mcForm'>
    For some reason the upload failed. This problem might be temporary
    or permanent. Try again.
    </div>
    ";
    endPage();
    }
    }

    }




    function printFormForIma geUpload() {
    extract($config = getConfig());
    // We need to print the form
    startPage("Note : certain image types don't work on the web. Upload
    images that have 'jpe' or 'jpg' or 'jpeg' or 'gif' or 'png' as their
    endings.");
    echo "
    <div class='dvclMcWh oleForm'>
    <form method='post' action='$self' enctype='multip art/form-data'
    class='mcForm'>
    Upload this image: <br>
    <input type='file' name='uploadedF ile'><br><br>
    <input type='hidden' name='choiceMad e' value='uploadIm age'>
    <input type='submit' value='Upload File'>
    </div>
    ";
    endPage();

    }
  • Christian Joergensen

    #2
    Re: chmod to 777 but still get permission denied on image upload

    On Sat, 09 Aug 2003 22:47:54 -0700, lawrence wrote:
    [color=blue]
    > I've been using the following function (yes, it is inelegant, what can
    > I say, I wrote it a long time ago) to upload images. Haven't had a
    > problem with it for at least a year, and I don't recall changing it
    > anytime recently. Nevertheless, the script is suddenly dying on this
    > line:
    >
    > if (copy($uploaded File, $pathToImageFol der)){[/color]

    Try using move_uploaded_f ile and $_FILES :-)

    --
    Christian Jørgensen | It's so complicated, it can't crash.
    http://www.razor.dk |

    Comment

    • lawrence

      #3
      Re: chmod to 777 but still get permission denied on image upload

      Christian Joergensen <mail@phpguru.d k> wrote in message news:<pan.2003. 08.10.12.23.14. 363062@razor.dk >...[color=blue]
      > On Sat, 09 Aug 2003 22:47:54 -0700, lawrence wrote:
      >[color=green]
      > > I've been using the following function (yes, it is inelegant, what can
      > > I say, I wrote it a long time ago) to upload images. Haven't had a
      > > problem with it for at least a year, and I don't recall changing it
      > > anytime recently. Nevertheless, the script is suddenly dying on this
      > > line:
      > >
      > > if (copy($uploaded File, $pathToImageFol der)){[/color]
      >
      > Try using move_uploaded_f ile and $_FILES :-)[/color]

      Aren't those new? The code I'm writing needs to run on all kinds of
      machines, some of which will be running old versions of PHP. As I
      recall, a year ago I changed the code to use move_uploaded_f ile, which
      worked fine till I uploaded the software to a machine running
      something like version 4.0.1 of PHP.

      Comment

      • lawrence

        #4
        Re: chmod to 777 but still get permission denied on image upload

        lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0308141517.1df2 6e8f@posting.go ogle.com>...[color=blue]
        > Christian Joergensen <mail@phpguru.d k> wrote in message news:<pan.2003. 08.10.12.23.14. 363062@razor.dk >...[color=green]
        > > On Sat, 09 Aug 2003 22:47:54 -0700, lawrence wrote:
        > >[color=darkred]
        > > > I've been using the following function (yes, it is inelegant, what can
        > > > I say, I wrote it a long time ago) to upload images. Haven't had a
        > > > problem with it for at least a year, and I don't recall changing it
        > > > anytime recently. Nevertheless, the script is suddenly dying on this
        > > > line:
        > > >
        > > > if (copy($uploaded File, $pathToImageFol der)){[/color]
        > >
        > > Try using move_uploaded_f ile and $_FILES :-)[/color]
        >
        > Aren't those new? The code I'm writing needs to run on all kinds of
        > machines, some of which will be running old versions of PHP. As I
        > recall, a year ago I changed the code to use move_uploaded_f ile, which
        > worked fine till I uploaded the software to a machine running
        > something like version 4.0.1 of PHP.[/color]



        Can anyone think of any non-permission errors?

        Comment

        • haptiK

          #5
          Re: chmod to 777 but still get permission denied on image upload

          what is the exact error you are recieving and what version of php are
          you running. this information is vital to providing the solution.

          - jpdr
          TTG

          lawrence wrote:
          [color=blue]
          > lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0308141517.1df2 6e8f@posting.go ogle.com>...
          >[color=green]
          >>Christian Joergensen <mail@phpguru.d k> wrote in message news:<pan.2003. 08.10.12.23.14. 363062@razor.dk >...
          >>[color=darkred]
          >>>On Sat, 09 Aug 2003 22:47:54 -0700, lawrence wrote:
          >>>
          >>>
          >>>>I've been using the following function (yes, it is inelegant, what can
          >>>>I say, I wrote it a long time ago) to upload images. Haven't had a
          >>>>problem with it for at least a year, and I don't recall changing it
          >>>>anytime recently. Nevertheless, the script is suddenly dying on this
          >>>>line:
          >>>>
          >>>>if (copy($uploaded File, $pathToImageFol der)){
          >>>
          >>>Try using move_uploaded_f ile and $_FILES :-)[/color]
          >>
          >>Aren't those new? The code I'm writing needs to run on all kinds of
          >>machines, some of which will be running old versions of PHP. As I
          >>recall, a year ago I changed the code to use move_uploaded_f ile, which
          >>worked fine till I uploaded the software to a machine running
          >>something like version 4.0.1 of PHP.[/color]
          >
          >
          >
          >
          > Can anyone think of any non-permission errors?[/color]

          Comment

          • matty

            #6
            Re: chmod to 777 but still get permission denied on image upload

            lawrence wrote:
            [color=blue]
            > haptiK <haptiK@yahoo.c om> wrote in message
            > news:<bhq9b2$b2 k$2@hercules.bt internet.com>.. .[color=green]
            >> what is the exact error you are recieving and what version of php are
            >> you running. this information is vital to providing the solution.
            >>
            >> - jpdr
            >> TTG[/color]
            >
            >
            >
            >
            > I've been using the following function (yes, it is inelegant, what can
            > I say, I wrote it a long time ago) to upload images. Haven't had a
            > problem with it for at least a year, and I don't recall changing it
            > anytime recently. Nevertheless, the script is suddenly dying on this
            > line:
            >
            > if (copy($uploaded File, $pathToImageFol der)){
            >[/color]

            well, you might want to try using the $_FILES['uploadedFile'] array -
            have a look at the PHP manual under "Handling file uploads"

            Matt

            Comment

            • lawrence

              #7
              Re: chmod to 777 but still get permission denied on image upload

              matty <matt+nntp@askm enoquestions.co .uk> wrote in message[color=blue][color=green]
              > >
              > > I've been using the following function (yes, it is inelegant, what can
              > > I say, I wrote it a long time ago) to upload images. Haven't had a
              > > problem with it for at least a year, and I don't recall changing it
              > > anytime recently. Nevertheless, the script is suddenly dying on this
              > > line:
              > >
              > > if (copy($uploaded File, $pathToImageFol der)){
              > >[/color]
              >
              > well, you might want to try using the $_FILES['uploadedFile'] array -
              > have a look at the PHP manual under "Handling file uploads"
              >
              > Matt[/color]


              As mentioned before, I'm trying to remain backward compatible to PHP
              4.0.3, if possible. But lets assume for a moment that backwards
              compatibility is not an issue. Why do you want me to use $_FILES? Did
              you see a place where I failed to account for the scope of a variable?
              If so, please let me know.

              -- lawrence

              Comment

              • Wes Bailey

                #8
                Re: chmod to 777 but still get permission denied on image upload

                Maybe a silly question now but did you check the ownership of the
                directory you are writing too? if the web server (usually setup as
                nobody:nogroup) doesn't own the directory or isn't part of a group
                that has access, you won't be able to access the files regardless of
                their permission.

                Wes
                [color=blue]
                > lkrubner@geocit ies.com (lawrence) wrote in message
                > news:<da7e68e8. 0308192248.6af4 9972@posting.go ogle.com>...
                > matty <matt+nntp@askm enoquestions.co .uk> wrote in message[color=green][color=darkred]
                > > >
                > > > I've been using the following function (yes, it is inelegant, what can
                > > > I say, I wrote it a long time ago) to upload images. Haven't had a
                > > > problem with it for at least a year, and I don't recall changing it
                > > > anytime recently. Nevertheless, the script is suddenly dying on this
                > > > line:
                > > >
                > > > if (copy($uploaded File, $pathToImageFol der)){
                > > >[/color]
                > >
                > > well, you might want to try using the $_FILES['uploadedFile'] array -
                > > have a look at the PHP manual under "Handling file uploads"
                > >
                > > Matt[/color]
                >
                >
                > As mentioned before, I'm trying to remain backward compatible to PHP
                > 4.0.3, if possible. But lets assume for a moment that backwards
                > compatibility is not an issue. Why do you want me to use $_FILES? Did
                > you see a place where I failed to account for the scope of a variable?
                > If so, please let me know.
                >
                > -- lawrence[/color]

                Comment

                • lawrence

                  #9
                  Re: chmod to 777 but still get permission denied on image upload

                  Let me put the question another way. When you upload the file, you can
                  treat it as an array variable like any other? If I say:

                  global $userfile;

                  then it is within scope inside of the function, yes??



                  lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0308200053.63ed 15eb@posting.go ogle.com>...[color=blue]
                  > matty <matt+nntp@askm enoquestions.co .uk> wrote in message news:<GCu0b.914 0$z7.1086512@wa rds.force9.net> ...[color=green]
                  > > lawrence wrote:
                  > >[color=darkred]
                  > > > haptiK <haptiK@yahoo.c om> wrote in message
                  > > > news:<bhq9b2$b2 k$2@hercules.bt internet.com>.. .
                  > > >> what is the exact error you are recieving and what version of php are
                  > > >> you running. this information is vital to providing the solution.
                  > > >>
                  > > >> - jpdr
                  > > >> TTG
                  > > >
                  > > >
                  > > >
                  > > >
                  > > > I've been using the following function (yes, it is inelegant, what can
                  > > > I say, I wrote it a long time ago) to upload images. Haven't had a
                  > > > problem with it for at least a year, and I don't recall changing it
                  > > > anytime recently. Nevertheless, the script is suddenly dying on this
                  > > > line:
                  > > >
                  > > > if (copy($uploaded File, $pathToImageFol der)){
                  > > >[/color]
                  > >
                  > > well, you might want to try using the $_FILES['uploadedFile'] array -
                  > > have a look at the PHP manual under "Handling file uploads"
                  > >
                  > > Matt[/color]
                  >
                  >
                  > I wrote a different script today, I was rewriting another programmers
                  > code, but ran into the same problem as before. All this code is being
                  > executed on the same server, though for different web sites. This line
                  > dies:
                  >
                  >
                  > if (!move_uploaded _file($userfile , $upfile)) {
                  >
                  >
                  > In this case it seems like I don't have $userfile. The variable seems
                  > empty. This is the form in use, and the function which receives it:
                  >
                  >
                  > <form enctype="multip art/form-data"
                  > action="/admin/mcFlashGalleryC ontrolPanel.php ?choiceMade=ins ertAndUploadNew Item"
                  > method="POST">
                  >
                  > <div id="mcFormBlock 0" class="mcFormBl ock">
                  > Title<br>
                  > <input id="inputId0" type="text" name="title" value=""
                  > class="textInpu t">
                  >
                  > </div>
                  >
                  >
                  > <div id="mcFormBlock 2" class="mcFormBl ock">
                  > File<br>
                  > <input id="inputId2" type="text" name="file" value=""
                  > class="textInpu t">
                  >
                  > </div>
                  >
                  >
                  > <div id="mcFormBlock 4" class="mcFormBl ock">
                  > Dimensions<br>
                  > <input id="inputId4" type="text" name="dimension s" value=""
                  > class="textInpu t">
                  >
                  > </div>
                  >
                  >
                  > <div id="mcFormBlock 6" class="mcFormBl ock">
                  > Price<br>
                  > <input id="inputId6" type="text" name="price" value=""
                  > class="textInpu t">
                  >
                  > </div>
                  >
                  > <span class="formText ">This is your current category: No category
                  > chosen yet. </span>
                  > <div id="mcFormBlock 9" class="mcFormBl ock">
                  > Choose a category <select id="inputId9" name="category" > <option
                  > value="false">N o category chosen yet</option> <option
                  > value="water">w ater</option> <option
                  > value="drawings ">drawings</option> <option
                  > value="other">o ther</option><option value="photos"> photos</option>
                  > <option value="oil">oil </option> </select>
                  > </div>
                  >
                  >
                  > <div id="mcFormBlock 11" class="mcFormBl ock">
                  > Description<br>
                  > <textarea id="inputId11" name="descripti on" rows="14" cols="50"
                  > class="textarea Input"></textarea>
                  >
                  > </div>
                  >
                  > <td> <input type="hidden" name="MAX_FILE_ SIZE" value="10000000 ">
                  > Upload this file:
                  > <input name="userfile" type="file"><in put type="submit"></form>
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > function insertAndUpload NewItem() {
                  > // $userfile is where file went on webserver
                  > // $userfile_name is original file name
                  > // $userfile_size is size in bytes
                  > // $userfile_type is mime type e.g. image/gif
                  >
                  > // 08-19-03 - this is receiving the input from
                  > printFormForIns ertAndUploadNew Item() - lk
                  > // $file or $userfile is the name of the file being uploaded,
                  > $filepath is from the config file, we get it so we know where to store
                  > // the file that just got uploaded.
                  > global $userfile, $filepath;
                  > global $db, $title, $file, $dimensions, $price, $description,
                  > $category;
                  >
                  > $results = "";
                  >
                  > $results .="Variables are:<br>";
                  > $results .= $userfile." ".$userfile_nam e." ".$userfile_siz e."
                  > ".$userfile_typ e."<br>";
                  >
                  > if ($userfile=="no ne"){
                  > $results .= "Problem: no file uploaded";
                  > }
                  >
                  > if ($userfile_size ==0){
                  > $results .= "Problem: uploaded file is zero length";
                  > }
                  >
                  > $upfile = $filepath.$user file_name;
                  > echo $results;
                  > if (!move_uploaded _file($userfile , $upfile)) {
                  > $results .= "Problem: Could not move file into directory";
                  > } else {
                  > $results .= "File uploaded successfully<br ><br>";
                  > }
                  >
                  > $title = addslashes($tit le);
                  > $file = addslashes($fil e);
                  > $dimensions = addslashes($dim ensions);
                  > $price = addslashes($pri ce);
                  > $description = addslashes($des cription);
                  > $catagory = addslashes($cat egory);
                  >
                  > $query = "INSERT INTO products VALUES(NULL, '".$title."' ,
                  > '".$file."', '".$dimensions. "', '".$price."' , '".$description ."', '".$catagory."' )";
                  > echo "<hr>here's the query: $query <hr>";
                  > $result = $db->query($query );
                  > $numOfRowsAffec ted = $db->rows();
                  > if($result) $results .= "$numOfRowsAffe cted row inserted into
                  > database.";
                  >
                  > // 08-19-03 - every function that does something should end by
                  > posting the results to the screen. - lk
                  > echo $results;
                  > }[/color]

                  Comment

                  • lawrence

                    #10
                    Re: chmod to 777 but still get permission denied on image upload

                    wesley_bailey@y ahoo.com (Wes Bailey) wrote in message news:<c396240d. 0308200031.842b 9c2@posting.goo gle.com>...[color=blue]
                    > Maybe a silly question now but did you check the ownership of the
                    > directory you are writing too? if the web server (usually setup as
                    > nobody:nogroup) doesn't own the directory or isn't part of a group
                    > that has access, you won't be able to access the files regardless of
                    > their permission.[/color]


                    That's a good question. I think I logged in with FTP, using a username
                    and password that wasn't root but had root level access. (The server
                    is aware of some "super-super-root" user that we try to never use. I
                    think there are 3 of us with normal root level access to the server.)

                    Comment

                    • lawrence

                      #11
                      Re: chmod to 777 but still get permission denied on image upload

                      If copy() fails, what reasons can it fail, other than permissions?


                      lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0308092147.40a4 23a1@posting.go ogle.com>...[color=blue]
                      > I've been using the following function (yes, it is inelegant, what can
                      > I say, I wrote it a long time ago) to upload images. Haven't had a
                      > problem with it for at least a year, and I don't recall changing it
                      > anytime recently. Nevertheless, the script is suddenly dying on this
                      > line:
                      >
                      > if (copy($uploaded File, $pathToImageFol der)){
                      >
                      >
                      > This is the error I get:
                      >
                      > Warning: Unable to access in
                      > /home/www/krubner/atp/mcIncludes/mcImages.php on line 199
                      >
                      >
                      > My first thought was to check permissions - they were set to 755, but
                      > to test if they were the problem I changed them to 777. Tried again
                      > and got the same problem. So then I added in the line, you'll see it
                      > below, where I try to echo out the values. This is what I get:
                      >
                      > here's the file name and here's the folder
                      > /home/krubner/www/atp/mcImages/[/color]
                      [color=blue]
                      >
                      >
                      > There is no file name. I assume that is the problem, but why is there
                      > suddenly no file name? (I'm running version 4.2.3 of PHP, if you're
                      > asking).
                      >
                      >
                      >
                      > function uploadImage() {
                      > extract($config = getConfig());
                      > global $forms, $io, $users, $links, $sql, $uploadedFile,
                      > $uploadedFile_s ize, $uploadedFile_n ame, $overRide;
                      > $uploadedFile_n ame = processFileName ($uploadedFile_ name);
                      > $uploadedFile_n ame = htmlspecialchar s($uploadedFile _name);
                      > if ($uploadedFile_ size > 10000000 && $overRide != "true") {
                      > startPage("This image is very large, over 10 megabyte. Are you sure
                      > you want to proceed?");
                      > echo "
                      > <div class='dvclMcWh oleForm'>
                      >
                      > <form method='post' action='$self' enctype='multip art/form-data'
                      > class='mcForm'>
                      > Upload this image: <br>
                      > <input type='file' name='uploadedF ile'><br><br>
                      > <input type='hidden' name='choiceMad e' value='uploadIm age'>
                      > <input type='hidden' name='overRide' value='true'>
                      > <input type='submit' value='Upload File'>
                      > </form>
                      > </div>
                      > ";
                      > endPage();
                      > } else {
                      > $pathToImageFol der .= $uploadedFile_n ame;
                      > $imagesFolder .= $uploadedFile_n ame;
                      > echo "<br><br><br><b r> here's the file name $uploadedFile_n ame and
                      > here's the folder $pathToImageFol der ";
                      >
                      > if (copy($uploaded File, $pathToImageFol der)) {
                      >
                      > startPage();
                      > echo "
                      > <div class='mcForm'>
                      > The image or file has been uploaded. If you wish to reference it
                      > this is the address:<br><br >
                      > <a href='$imagesFo lder'>
                      > $imagesFolder
                      > </a>
                      > <BR><BR>
                      > The code for a link to this image would look like this:<br><br>
                      > &lt;img src='$imagesFol der'&gt;
                      > <br><br>
                      > Put this code on any page where you want this image to appear:
                      > <br><br>
                      > <img src='$imagesFol der'>
                      > <br><br>
                      > The ALT tag controls what text appears when the mouse cursor hovers
                      > over an image. If you type &lt;img src='myImage.jp g'
                      > ALT='Photo taken in downtown Charlottesville '&gt; then the words
                      > 'Photo taken in downtown Charlottesville ' are what appear.
                      > <a href='http://www.htmlhelp.co m/reference/wilbur/syntax.html'>Yo u
                      > can read more about IMG tag syntax on htmlHelp.com</a>
                      > <br><br>
                      > Also note that if you want an image to float in the middle of a
                      > column, just put the tag &lt;center&g t; before it and the tag
                      > &lt;/center&gt; after it. (Hopefully all this code writing will be
                      > automated in future versions of this software; for now,
                      > sorry folks, but you've got to hand edit these tags if you want
                      > them any different than how they are listed below.)
                      > </div>
                      > ";
                      > endPage();
                      > } else {
                      > global $forms, $io, $users, $links, $sql, $users;
                      >
                      > startPage();
                      > echo "
                      > <div class='mcForm'>
                      > For some reason the upload failed. This problem might be temporary
                      > or permanent. Try again.
                      > </div>
                      > ";
                      > endPage();
                      > }
                      > }
                      >
                      > }
                      >
                      >
                      >
                      >
                      > function printFormForIma geUpload() {
                      > extract($config = getConfig());
                      > // We need to print the form
                      > startPage("Note : certain image types don't work on the web. Upload
                      > images that have 'jpe' or 'jpg' or 'jpeg' or 'gif' or 'png' as their
                      > endings.");
                      > echo "
                      > <div class='dvclMcWh oleForm'>
                      > <form method='post' action='$self' enctype='multip art/form-data'
                      > class='mcForm'>
                      > Upload this image: <br>
                      > <input type='file' name='uploadedF ile'><br><br>
                      > <input type='hidden' name='choiceMad e' value='uploadIm age'>
                      > <input type='submit' value='Upload File'>
                      > </div>
                      > ";
                      > endPage();
                      >
                      > }[/color]

                      Comment

                      • Allodoxaphobia

                        #12
                        Re: chmod to 777 but still get permission denied on image upload

                        On 31 Aug 2003 16:30:41 -0700, lawrence hath writ:[color=blue]
                        > If copy() fails, what reasons can it fail, other than permissions?[/color]

                        Even tho' you top-posted - and did not trim...

                        Have you check permissions on the *directory* ?

                        Jonesy
                        --
                        | Marvin L Jones | jonz | W3DHJ | OS/2
                        | Gunnison, Colorado | @ | Jonesy | linux __
                        | 7,703' -- 2,345m | config.com | DM68mn SK

                        Comment

                        • matty

                          #13
                          Re: chmod to 777 but still get permission denied on image upload

                          lawrence wrote:
                          [color=blue][color=green]
                          >>
                          >> if (copy($uploaded File, $pathToImageFol der)){
                          >>
                          >>
                          >> This is the error I get:
                          >>
                          >> Warning: Unable to access in
                          >> /home/www/krubner/atp/mcIncludes/mcImages.php on line 199
                          >>
                          >>[/color][/color]

                          Your error is here. standard form of this error message is

                          Warning: unable to access /var/files/foo/bar in
                          ....

                          Chances are, the variable you're using for the filename is
                          empty. Are you using $_FILES, or are you using an old,
                          register_global s on style variable?

                          Comment

                          • lawrence

                            #14
                            Re: chmod to 777 but still get permission denied on image upload

                            Allodoxaphobia <bit-bucket@config.c om> wrote in message news:<slrnbl728 b.klo.bit-bucket@localhos t.config.com>.. .[color=blue]
                            > On 31 Aug 2003 16:30:41 -0700, lawrence hath writ:[color=green]
                            > > If copy() fails, what reasons can it fail, other than permissions?[/color]
                            >
                            > Even tho' you top-posted - and did not trim...
                            >
                            > Have you check permissions on the *directory* ?
                            >
                            > Jonesy[/color]

                            Thanks, but yes, we checked permissions on the directory many times.

                            Comment

                            • lawrence

                              #15
                              Re: chmod to 777 but still get permission denied on image upload

                              matty <matt+nntp@askm enoquestions.co .uk> wrote in message news:<3OO4b.289 1$4L1.499595@wa rds.force9.net> ...[color=blue]
                              > lawrence wrote:
                              >[color=green][color=darkred]
                              > >>
                              > >> if (copy($uploaded File, $pathToImageFol der)){
                              > >>
                              > >>
                              > >> This is the error I get:
                              > >>
                              > >> Warning: Unable to access in
                              > >> /home/www/krubner/atp/mcIncludes/mcImages.php on line 199
                              > >>
                              > >>[/color][/color]
                              >
                              > Your error is here. standard form of this error message is
                              >
                              > Warning: unable to access /var/files/foo/bar in
                              > ...
                              >
                              > Chances are, the variable you're using for the filename is
                              > empty. Are you using $_FILES, or are you using an old,
                              > register_global s on style variable?[/color]

                              I'm not sure why you're asking since you can see all my code. The
                              variable seems to be empty but note these lines:

                              [color=blue]
                              > global $userfile, $filepath;
                              > global $db, $title, $file, $dimensions, $price, $description,
                              > $category;[/color]


                              Earlier in this thread someone asked if I was using $_FILES and I
                              explained I wasn't because we were trying to stay backwards compatible
                              with PHP 4.01. However, as I recall, sometime last month I did switch
                              over and use $_FILES just to see if it would help. It didn't.

                              Comment

                              Working...