Uploaading a copy of attachments.
#1
Question 
I would like to make it so, that when somebody uploads attachments, the attachments are being copied into backup-folder, (and the copy stays in the backupfolder if the original attachment are deleted).


It would be perfect if the filename could be something like:
Profilename + date of posting + time of posting + original filename + filetype

so If I posted an attachment the backup-copy would be called something like:

The_Nerd-082207-1705-IMG93453.JPG
("082207"=date and "1705"=time)

I hope someone here can tell me how to do that? Smile
(I am a novice in this, so I will need an exact to-do, if I am to succeed) Shy
Reply
#2
No replies so far Sad

Is thart because it is difficult to do?
or have I explained what I wich to do to badly?

The filename part is not so important, so if that is what makes it difficult, then it is fine, if the copy is called, what it also is called in the upload-folder.
Reply
#3
Ok, this will copy the uploads to a backup directory using the same filename as MyBB uses.

1) Create a directory called "backup" in your "uploads" directory and CHMOD it to the same value as used for your "uploads" directory.

2) Open "./inc/functions_upload.php" in a text editor, I recommend NotePad++ and on Line 319;
After:
$file = upload_file($attachment, $mybb->settings['uploadspath'], $filename);
Add:
$file2 = upload_file($attachment, $mybb->settings['uploadspath']."/backup", $filename);
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#4
MrDoom Wrote:Ok, this will copy the uploads to a backup directory using the same filename as MyBB uses.

1) Create a directory called "backup" in your "uploads" directory and CHMOD it to the same value as used for your "uploads" directory.

2) Open "./inc/functions_upload.php" in a text editor, I recommend NotePad++ and on Line 319;
After:
$file = upload_file($attachment, $mybb->settings['uploadspath'], $filename);
Add:
$file2 = upload_file($attachment, $mybb->settings['uploadspath']."/backup", $filename);

Thanks a lot Big Grin
I will try that immediatly Smile

And thanks alså for the tip about using NotePad++ I will take a look at that one Smile
Reply
#5
I have now addet the line, and the directory and made it writeable.
but the attachments are not being coppied into the backup-directory Sad
Reply
#6
Try this.

Please do not PM me about problems you might be having with MyBB. Post a thread, and someone on the support or development team will take a look at it.
Reply
#7
LegosJedi Wrote:Try this.


Thanks a lot Big Grin
I have tried it out, and it worked just fine Big Grin
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)