WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Cannot delete images
no permission

Version:
printPrint


Cannot delete images
Jenny
Forum Regular
Avatar

Usergroup: Customer
Joined: May 11, 2003
Total Topics: 40
Total Posts: 119
Posted 11/11/04 - 07:39 AM:
quote post
#1
I'm using the threaded attachments directory for my galleries. I recently deleted a few categories, but I am not able to delete the files from my server.
The files do no longer exist in the gallery database, obviously. So I tried the 'Unused attachments' feature. But the script couldn't find the files, which are not in the /attachments folder, but in a subfolder.
Last, but not least, I logged in with WS_FTP and tried to delete the files manually. But this doesn't work, either. I only get error messages, telling me that I don't have permission to delete the file. In fact I can't do anything with it. Neither change the name, nor change the permission or move the file. It doesn't even work with the CPanel file manager. I can't get rid of the files!
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6339
Posted 11/11/04 - 02:21 PM:
quote post
#2
Via FTP, the issue would be that your host isn't using phpsuexec and so the files are owned by apache's user (usually 'nobody' ) instead of your own user account.

As for the unused attachments not checking subdirectories, I'll have to check into that.

Edited by Paul on 11/11/04 - 02:23 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 11/11/04 - 02:45 PM:
quote post
#3
I use a small php script now to delete specific directories that were left behind right now. Haven't tried the latest version yet, so not sure if that is still necessary.
Jenny
Forum Regular
Avatar

Usergroup: Customer
Joined: May 11, 2003
Total Topics: 40
Total Posts: 119
Posted 11/23/04 - 07:52 AM:
quote post
#4
Quantum, can you tell me how you delete the folders? Whatever I've tried, it doesn't seem to work
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 12/30/04 - 07:12 AM:
quote post
#5
Hmmm, super slow reply.

I use this PHP Script:


read() ){
if($f != "." && $f != ".."){
if(is_dir($dir.$f)){
echo $dir.$f."/";
deltree($dir.$f."/");
rmdir($dir.$f);
} // if
if(is_file($dir.$f))
unlink($dir.$f);
}// if
}// while
$d->close();
}
?>
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 12/30/04 - 07:13 AM:
quote post
#6
It has to be manually configured to take care of the correct directory / files.

Then I run it through my browser. Be very careful when using it though.

Will add this thread as a feature suggestion for WSN Links .
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6339
Posted 12/30/04 - 08:09 AM:
quote post
#7
See the CHMOD script already posted in the complete hacks forum. It doesn't delete, but it does set the permissions so that you can delete by FTP. (I may add a delete option to it.)

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 12/30/04 - 05:11 PM:
quote post
#8
Hadn't seen that one yet. It looks like it also takes care of directories and subdirectories. Nice!

Will leave this thread as a feature suggestion in WSN Links (might be more appropiate in WSN Gallery) though. As it seems to me it'd be good if the script itself has a good mechanism for cleaning up the files & directories it itself leaves scattered about.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6339
Posted 01/01/05 - 10:43 PM:
quote post
#9
I intend to have it as an admin panel option in 3.20 / 2.20, but decided to release it as a hack first since those version releases are likely many months away.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 01/02/05 - 11:23 AM:
quote post
#10
One VERY annoying side effect of this all is that I can't use the FTP import feature as I can't upload files to the directory (no authorization). So I'm forced to use the tar upload feature (which seems excruciatingly slow for even a very limited number of files).

Any workarounds possible? Maybe one in which a script is run that gives permission to both users?
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 01/02/05 - 12:59 PM:
quote post
#11
Hmmm. Interesting. The FTP import uses the main attachments folder instead of the actual directory in which the files have to end up. Meaning I can make use of it, as that directory is still accessible to me.

However, it also adds all directories and non-to-be-uploaded files as items to the directory. Which adds 10-15 nonsense items on every mass upload.

Meaning I changed tarupload.php to use a subdirectory of attachments ("uploader"), which doesn't contain all of those potential nonsense files.

Summary:
- It works.
- FTP Import is bugged now that the attachment tree has been introduced.
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 39
Total Posts: 173
Posted 01/02/05 - 01:23 PM:
quote post
#12
When regenerating it gives alot of errors about being unable to unlink files. Probably also has to do with it not having access to delete the files in the upload directory.

Doesn't impact the functionality.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6339
Posted 01/03/05 - 12:51 AM:
quote post
#13
If you've done the chmoding, it should have permission.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.