![]() |
Create files from attachments
This is not like the attachments as files hack, it is simply a way to import files from the attachment table to real files for whatever reason, maybe you just wanted an actualy backup of the files instead of the database.
Simply upload the file into your admin directory. Open up /admin/index.php look for PHP Code:
PHP Code:
|
another useful hack from scott, the new mod
|
I dunno if its just me, but when I press the link to it:
Code:
http://forums.jadelit.com/admin/attachment_export.php&s=6d2a081fa5f4a3ab0e24df9b210dbb83 Code:
http://forums.jadelit.com/admin/attachment_export.php ? |
WoW!!! ;)
The long-awaited stand alone exporter !!! Great! (Scott, do you remember our thread about in beta ? ;) ) This point, seems it's missing only the 2-way converter, if anyone would come back to the db-version of attachments... :D :D :D :D :D :D :D I'm jokin'... of course. Great job as usual. Bye |
em i missed the action bit, re-apply the change to your /admin/index.php from the first post
|
On a side note, this hack RELIES on two files not having the same name, if they do it will just rewrite the first one with later ones.
|
ok great, thanks
|
Are you sure that this:
if ($action == "import") { doformheader("attachment_import","doimport"); maketableheader("Add New Forum"); Shouldn't be this: if ($action == "import") { doformheader("attachment_export","doimport"); maketableheader("Add New Forum"); |
Thx Scott :) This is our first request that has actually turned into a hack, LOL!!
Thanx buddy, gonna use it right away ;) |
Well, it has worked really well... Now we have a HUGE folder with a LOT of attachments! :D
Would it be possible to make a zipped output of the backup instead of all the files in one folder? Thanx again for the hack ;) |
nope thats definately beyhond the limitations of php, yes it wouldn't be hard to zip a couple of files, but it would have a limit of about 30mb worth of files as if you tried to zip any more i'm sure that php would run out of memory.
You can simply tar then gzip it in shell tar -cvf attachments.tar attachments gzip attachments.tar and you get attachments.tar.gz |
Does this export all files, or can you choose only certain attachments? I don't want people to be able to download all the file without having to do some through the board (because it gives download counts).
|
It exports all files, though I'm workin on an attachment manager which allows you to manipulate attachments via the admin panel, delete attachments, view attachments, rename attachment, make attachment to file or upload a new attachment. You can also sort the attachments via size and search and other things really.
|
Oh that's great thanks :)
If you need a beta tester let me know ;) |
I'm getting the following error:
Warning: fopen("/home/reefaqua/public_html/forums/attachments/hermit crab small.jpg", "wb") - Permission denied in /home/reefaqua/public_html/forums/admin/attachment_export.php on line 32 Warning: Supplied argument is not a valid File-Handle resource in /home/reefaqua/public_html/forums/admin/attachment_export.php on line 33 Any ideas? |
chmod the attachments folder to 666
|
w00t now I have a huge folder with all attachments. That was fun... :D
|
PPN i love this hack!!
i wanted this for sooooooooooooo long.. actually check out my sig request at https://vborg.vbsupport.ru/showthrea...threadid=32024 maybe a further extension of this hack ? :) |
does this hack actually delete the original attachments in the database or keeps them after exporting?
looked at my attachment table and it's 225mb in size! |
It leaves them in the database though if you want to have all attachments as files instead ot the databse then look in my huge long sig and the attachments as files imports all the attachments and when you upload attachments it puts them into a folder.
I could do the forum gallery hack but I have too little time spread too thinly (is that a word?) |
https://vborg.vbsupport.ru/showthrea...threadid=35193 is the URL and boy that last post was screwed up, sorry for my bad english :) thats what you get when your first language is gaelic
|
Quote:
|
I done it in 1024 x 768 :D
well chen done it, I had it all on a new line but my sig was getting a bit long lol I might make it an image, though I wonder if i could write some vBcode to allow the use of image maps |
i get:
Warning: fopen("/sites/d/digital-forums.com/htdocs/www/attatchments/wet.zip", "wb") - Permission denied in /sites/d/digital-forums.com/htdocs/www/forum/admin/attachment_export.php on line 32 Warning: Supplied argument is not a valid File-Handle resource in /sites/d/digital-forums.com/htdocs/www/forum/admin/attachment_export.php on line 33 Imported wet.zip and yes i chmod correctly to 666 |
You need to CHMOD 0777, no?
|
Warning: fopen("/sites/d/digital-forums.com/htdocs/attach/eval-corp.gif", "wb") - No such file or directory in /sites/d/digital-forums.com/htdocs/www/forum/admin/attachment_export.php on line 31
Warning: Supplied argument is not a valid File-Handle resource in /sites/d/digital-forums.com/htdocs/www/forum/admin/attachment_export.php on line 32 now I get this message any clues ? |
PS im using 2.2.4
|
you definately created the attach folder and chmod it to 0777 this is vital as the problem is definately with permissions, this is the only reason it would stop attachments from being created.
|
yes definatley
after some tweeking it now says import successful (no erroes) but theres no files in the folder very very strange ? |
what do you mean by tweaking?
changing the file or the permissions? |
hard coded the root path
the script sumps the files - but all i can see is the folders growing in size but there is nothing in the folders im tearing my hair out !!! |
eventually, I got it to work. Thanks, good hack! :):up:
|
Is there a way to do the reverse thing, to import the files in the database ???
That would be helpfull since i have to backup all my forum manually due to my crap host ;-\ Great hack btw :) |
I will see what i can do.
|
Worked great, thanks.
|
I installed the hack, but haven't used it yet. If i use it, will it remove the files from the database, or just copy them? Thanks.
|
Iam getting the followring error when trying to export files from Database
Please help, Thanks Warning: fopen(/usr/local/apache/htdocs/mydomain.com/attachments/untitled.gif) [function.fopen]: failed to create stream: No such file or directory in /usr/local/apache/htdocs/exriders.com/vbb/admin/attachment_export.php on line 32 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/apache/htdocs/mydomain.com/vbb/admin/attachment_export.php on line 33 |
Quote:
sound like the directory does not exist or is not set to 777. - jeff |
All times are GMT. The time now is 04:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|