News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Request for Mod : Complete board attachment download

Started by Fearless Freap, May 24, 2012, 04:12:14 PM

Previous topic - Next topic

Fearless Freap

Hi,

I run a heavy attachment forum, there can be as many at 70 to 100 attachments in a topic.  I would like to back up these attachments without having to go through each individual file.  I know attachments are located in the database, under a different file name but to rename, and then figure out where it was originally is an incredibly taxing problem.

My thought is... is it possible to piggyback off the attachments, browse files section...

To be able to sort them by board, add an additional check box that will download the file(s) to my hard drive or specified location as apposed to delete.

One of the things I have noticed so far is that there could be multiple files with the same name, so a rename might be necessary to keep some files from being overwritten. 

One though would be by post number like this:  File name is  sample.jpg x 5 copies of the same file.

Rename: Post #1, 5 attachments
001a sample.jpg
001b sample.jpg
001c sample.jpg
001d sample.jpg
001e sample.jpg

seen again Post #20, 2 attachments
020a sample.jpg
020b sample.jpg

Or some type of naming system that will allow for an unlimited system of renaming.

What do you think?

Thanks,

Steve

Arantor

If you just want to carry a backup, just download the attachments folder on your server. You don't actually have to have the file names correctly, provided the database is backed up too.

Fearless Freap

I do have that backed up... my problem is that I had some files get corrupted on the server and I wanted to restore a handful of attachments... but to find the specific attachment, convert the server file back into it's original file name and file type is so incredibly tedious.

I just wanted a simple way of matching the original forum location and it's corresponding files with a file structure that mirrors the forum so I can locate the original file and reload it if necessary.  If there is an easier way of doing this I would love to know how to do that.

-Steve

Arantor

That's the thing, if you have a backup, it's possible to locate the file about as easily. Hover over the attachment, the URL to it will be something like http://example.com/index.php?action=dlattach;topic=1.0;id=1

Now, if you look in the attachments folder, you'll see a file like 1_file.jpgsomenumbersandletters

The number at the start there is the same as the id= number at the end of the URL. From that, you can upload the individual files you need to restore.

Advertisement: