Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Mar 2003
    Location
    earth
    Posts
    3
    Member #
    868
    Hi.

    I've been looking around for a whole day for a solution to my problem and searched not only this forum for an answer, but multiple others... I've seen multiple similar posts/questions, but none of them answered properly and/or relevant to my case. I've lost hope by now... so here's my last resort!

    I make directories through php, with mkdir() (with permission properly set to 0777). Then, I proceed to upload files into those directories (yet again with permission properly set to 0777 (!) ), still through php, with move_uploaded_file(). Up to now, everything's fine.

    The problem? I can't delete the uploaded files through php (with unlink)

    Why?
    -The created directories and uploaded file have 'apache' as owner.
    -I can't upload the files through ftp_connect() (& etc.) since my host doesn't seem to even recognize that function: I could have uploaded the files as my ftp user, so much for that option.
    -I can't chown the directories and/or the files (obviously... but before someone suggest it)

    Hrm. The only thing I can do (the files are pictures) is show the pictures. But that's not enough for my purposes!

    Is there really a solution to this problem? With all the reading I've doing, I don't think so.... but then again, I'm sure there should be!

    Aside: I first thought that permissions were the problem, but when I figured out how to give 0777 to both directory and file, and still couldn't delete the file... it really threw me off. I mean, doesn't having all permission sufficient enough for whoever to do whatever he wants with a file? /me confused.

    cheers,
    tapootz.
    PS. Oh, and yes SAFEMODE is enabled on the server... and no, there's nothing I can do about that.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I've gotten this error before and I'm sorry to say I never found a way around it. Extremely frustrating to say the least.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Mar 2003
    Location
    earth
    Posts
    3
    Member #
    868
    ugh.

    Well, the only way I thought "around" it is to upload all the files in the same user owned directory, and make virtual directory references in the database. But this is such a lame solution that I thought it would be possible otherwise.

    This really sucks... speechless.

  5. #4
    Junior Member
    Join Date
    Mar 2003
    Location
    earth
    Posts
    3
    Member #
    868
    Got it to work! w00t!

    Looks like safe mode is the culprit indeed. Your script is owned by a different user then the files that you want to delete, and that is not allowed.

    The trick is to upload a copy of your script, so this copy will also have the owner 'apache', and that copy of the script should be able to delete the other files.
    So with my upload script, I uploaded all the .php files to the web (including the 'upload' script, since it had no problem of performing his taks while overwriting itself). And tada! All problems solved.

    cheers,
    tapootz.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:35 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com