![]() |
It would be nice if this functionality is included in the standard VB I mean put the attachment into an attachment directory (off the docroot), and perhaps some options as to whether it should use the real name (allowing / disallowing duplicates) or hashed version.
attachments into the DB is making the DB so big :( taking a long time to backup / restore it. |
Is there a hack to extract all the existing attachment from db into files ?
|
test
|
Looks like a great hack-i get all the way through to step one in functions php
then i crash when i add this //we got this far, attachment passes the tests //the file should now be in the directory lets simply insert the data into the database $visible = iif($moderate,0,1); $DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$v isible','$attachment_hash')"); $attachmentid=$DB_site->insert_id(); } return $attachmentid; } // ###################### Start removeattachment ####################### function removeattachment ($attachmentid) { global $DB_site,$attachpath; $fileinfo = $DB_site->query_first("SELECT attachmentid, hash FROM attachment WHERE attachmentid='$attachmentid'"); $path = "$attachpath/$fileinfo[hash].file"; unlink($path); } any ideas why this crashes my board? tx! :D |
Quote:
48MB -> 84KB :) Thanks for making this hack!!! |
BUMP
|
maverick your applying the patch wrongly, make sure that you are doing it correctly you should completely remove the accept_attachments function and then replace it with the ew one.
|
this hack wouldnt work for me
in fact it TOTALLY screwed my board up-and i am quite experienced at applying hacks ive uninstalled the hack-and am using vb default php files and guess what?-my attachments dont show---period. nothing shows now people think they are uploading an attachment-and no errors occur-but no file either-so they post 3 times trying to upload it-and NOTHING i dont get it-how could such a simple hack do so much damage :mad: :( :mad: :( |
Hi, thanks for this hack it is a rock
But I have a problem with the imported files, after installation every things work well. but when I checked the attachment folder I noticed there are a duplication in most of files, yes it has different name but there are 3 or 4 copy of each file, so is there any way to determine unused file and delete them to save the space |
the files can't be the same, they wouldn't be able to exist as they would have been overwritten. The files may look the same as it uses a md5 hash to create it.
|
All times are GMT. The time now is 11:52 AM. |
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:
|