vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=323528

Copy Attachments in file-system
by muffel
26 Sep 2016 13:23

We have a forum, where all attachments are in the database... and they should stay in the database.

But I want to download all attachments in our forum to a special folder on the server... where I also can then see, from which user this attachment is... and the extension should also be right - for example ".jpg" ... Is there a workaround for this?

Thank you!

Brandon Sheley 26 Sep 2016 17:42

I wouldn't suggest this but you can set your folder to a public location. All files will be in numbered folders.

muffel 26 Sep 2016 17:57

Thank you - but I know this way. I want to keep the files in the database - just make a copy of them into the file-system. :)

Dave 26 Sep 2016 17:59

As far as I know there's no automated tool for this.
You'd have to make a script for it or find someone to make a script for you to export it from the database into the filesystem with the right filename and extensions and into user folders.

Brandon Sheley 26 Sep 2016 17:59

I wouldn't keep them in the database regardless, that's for sure.
It's smarter to have them in the file system. It's mapping like you're asking that's the not so easy part.

TheLastSuperman 26 Sep 2016 22:45

Guys - how now brown cows!

This is so easy it hurts (lol) i.e. just move them to filesystem (so it generates the files accordingly) then copy the files so you have the "copy" of the attachments you desire. Of course the files will not have the proper names but will be viewable in an image editor. Once done downloading simply move them back into the database and done.

Super easy unless I missed something? :cool:

Edit: Ahh I see why you all thought... okay okay so basically yes it will be for example file names such as 34.attach and then the thumbnail would be 34.thumb which is clearly not 34.jpg or 34.png HOWEVER you can open these via photoshop OR a free program called Gimp 2 and they will open and display the file fine for viewing, you can then save to a proper windows style extension instead of vBulletins .thumb/.attach etc etc.


All times are GMT. The time now is 01:57.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.