Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Is there a way to remove files from Coppermine without actually deleting them?  (Read 3387 times)

0 Members and 1 Guest are viewing this topic.

slausen

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67

Hi-

I am trying to get movie thumbs working, and it looks ike the only way to attach thumbs to movie files is by altering the thumb filename to be the same as the movie filename, and doing a batch-add. Okay, except I already batch added some movie files without the thumb file being in the same directory. So what I want to do is remove some files from Coppermine WITHOUT deleting them from the server (because what I want to do is batch-add them again, this time with the thumb files in the directory)

But it seems like there is no way to do that?!?

I already accidently deleted a bunch of files by mistake (fortunately I had copies) - given that files can exist on disk without being "available" in Coppermine, I just assumed that a "delete" operation would only delete the files records in the database, not in the filesystem... Is there a way to NOT have Coppermine delete files from disk and just have them removed from the Coppermine DB? I looked in the doc and the Admin and couldn't see a way to do this. Thanks.
« Last Edit: March 11, 2006, 01:04:55 am by Nibbler »
Logged

slausen

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67

I just wanted to add that I have movie thumbs working now, BUT I would still like to get clarification on this issue.

The reason is that I need to know whether I need to plan for additional storage to store backup copies of a large number of movie and photo files on my server. Obviously, it is a huge risk to have a bunch of content hooked into Coppermine, if the entire library could be deleted by one poorly trained Admin user. Also, it will become an issue during server moves since paths (to content) may change.

But in the short-term, I am concerned about what will happen if I decide to change the way my gallery is organized, and want to shuffle around different categories and albums. Or even if I need to make changes to my underlying files - one thing I noticed is that Coppermine actually renamed some movie files in the content directory to remove spaces, and I don't remember seeing in the doc that it was going to do that. How will Coppermine handle changes in the underlying filesystem in this case? What if I need to modify my video files? (like to add a watermark or change the compression). If I hadn't been looking in that directory, I wouldn't have even known that the filenames on the server had changed, and are now out of sync with the filenames on my (local) machine that I use for editing.

There are many situations where I can see myself needing to modify a file or gallery in Coppermine, where I would want to remove the file from Coppemine but still retain the file on disk.

It would be great to find out what the answer is. Or mybe what the best practices or workarounds might be. Thanks.
Logged

Nibbler

  • Guest

You can disable file deletion by modifying the delete_picture function in delete.php. I think I have posted the details of this previously, try a search.

You shouldn't alter the directory structure directly since Coppermine does not monitor this - it assumes files will stay where they are.

Coppermine renames files according to the list of illegal characters you have set in config. If you don't want spaces replaced with an underscore then you can remove the space character from this list, but be aware that spaces in file and folder names are to be avoided, which is why this feature is there in the first place.

There is a plugin available to facilitate replacing files via the web browser, this works well for pics but would not be suitable for large videos.

If you do replace files on the disk then you can have Coppermine re-scan the files and update the filesize and dimension information via admin tools, providing the filename remains unchanged.
Logged

slausen

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67

You can disable file deletion by modifying the delete_picture function in delete.php. I think I have posted the details of this previously, try a search.

You shouldn't alter the directory structure directly since Coppermine does not monitor this - it assumes files will stay where they are.

Coppermine renames files according to the list of illegal characters you have set in config. If you don't want spaces replaced with an underscore then you can remove the space character from this list, but be aware that spaces in file and folder names are to be avoided, which is why this feature is there in the first place.

There is a plugin available to facilitate replacing files via the web browser, this works well for pics but would not be suitable for large videos.

If you do replace files on the disk then you can have Coppermine re-scan the files and update the filesize and dimension information via admin tools, providing the filename remains unchanged.

Hi-

Thanks for that info :)

I did a search on "delete_picture" and "delete.php" and didn't find anything describing a method for disabling delete. Also I looked at delete.php inside the CPG root and it looks like it is just modifying the DB (although I could be wrong about that).

Do you have any idea where I can find specific info about how to disable file deletions?

I am even more concerned now that I see that "delete.php" is at the root of the site... is there anything preventing a malicious individual from passing in bad parameters to "delete.php" and deleting my entire content library?

Thanks.
Logged

Nibbler

  • Guest

http://forum.coppermine-gallery.net/index.php?topic=2272.msg10277#msg10277 still applies to 1.4

unlink() is the command used to delete a file.

delete.php checks user rights before any deleting is allowed :)
Logged

slausen

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67

http://forum.coppermine-gallery.net/index.php?topic=2272.msg10277#msg10277 still applies to 1.4

unlink() is the command used to delete a file.

delete.php checks user rights before any deleting is allowed :)

Fantastic! That's just what I was looking for - thanks! I'm not sure why that didn't show up in the forum search results.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.