Re: Attachment Mod 2.0.1 by Frank H

sounds like your serverapplication denies too large files

in chapter 1.6 you can see what variables that affect this, and how they relate to each others. And then use the php info page to see what they are, afterwards jump to "Alter settings" in the Attachment mod plugin interface and set the "Max filesize" according to the documentation.

I wrote something about it in my installation guide, see the "Setup the mod" part.

(in the next version I migth use the tags for overriding stuff, but I'm not sure it will work on all servers, I need to look into that wink)


Re: Attachment Mod 2.0.1 by Frank H

I have this mod up and running...  Wonderful!  Thanks for all your work.

Are you still developing/adding features to this mod?


Re: Attachment Mod 2.0.1 by Frank H

well ... yes/no ... hehe ... this version I'm only doing security patches on (and other bugfixes) ... but when 1.3 is released, I'll rewrite what's needed and also fix some things I've noticed needs improvement, either way, I'm still going to try to keep it fairly minimalistic, so no javascripts etc. is planned.


Re: Attachment Mod 2.0.1 by Frank H

sounds good.  I'll look forward to those updates.

The one thing that I would love to see has been mentioned before, and thats a slicker option for multiple uploads.  The image attachment mod has a great way of letting the user select the number of upload slots needed.  But that is JS. 

anyway, great mod.  Thanks for all your work.

255 (edited by nrwilk 2006-05-06 03:27)

Re: Attachment Mod 2.0.1 by Frank H

May I please ask how to create a directory where browsers aren't allowed?

Above my www.mydomain.com directory?  Or, perhaps with limited permissions?  If it has limited permissions, is it that php will have permission there and not other users?  I checked the owner of the files within my cache directory, and those are owned by me.



Re: Attachment Mod 2.0.1 by Frank H

What I mean is something like this:

- some folder
    +- WWW
    |    |
    |    +- Forum
    +- Secret
         +- Attachments
         +- Configurations

So that PHP fetches the attachmenst from a directory outside of where the html and php files are located.
Some place where you cannot reach if you type an url in your browser.

But if you run an apache server, then the .htaccess files should take care of any unwanted access, as it will deny all get, post & put on those directories. But then the .htaccess will make sure the directory doesn't allow browsers, sort of smile
for servers not using .htaccess there's still an index.html that will make an empty page, but those servers can be bruteforced to fetch the attachments, so it's most important on those to make sure it's not in the same place as the usual webfiles.

If you get the cache in the same name I suppose a chmod 700 could work (needs testing so that you know you can up/download), if you and php is in the same group a 770 would probably be enough. Either way, in future versions (when I remake it to fit 1.3) I'll make so that you can change the chmod on newly created directories much more easy (I'll put something in the admin interface).


Re: Attachment Mod 2.0.1 by Frank H

I don't know much about how this all works, but I wanted to ask.

Is it possible to present users with a progess bar while their files are uploading?


Re: Attachment Mod 2.0.1 by Frank H

not without adding a bunch of javascript, which I won't add

(And I'm still not certain how well it would work)

Re: Attachment Mod 2.0.1 by Frank H

Hey Frank; looks like a great mod, but unfortunately I am having some problems installing it. I'm not sure if you covered it in previous posts but I will look through them all after I post this...

When I go to attach a file, it doesn't attach it at all. When I post the first message with an attachment I don't get an error message or anything, the file just simply isn't there. When I go to attach a file when editing a post, I get the error message

An error was encountered
Error: Unable to move file from: /tmp/phplONGxB to /fdd9a2105a1987e906edb5ffb9f65cab.attach.

When I go to edit the attachment folder in the 'Alter Settings' spot in the Administration, I can change them and all but I don't really know if they're changed; it says they change, but when I go back to 'Alter Settings' everything is blank, making me think I didn't really alter anything.

Is there another file that I need to edit to specify which folder I want attachments to go to? And also how do I fix that error above that I quoted?

Thanks! smile


Re: Attachment Mod 2.0.1 by Frank H

I solve things easier over mail (as I access them from most places), so you can mail to me using the form on the left. (plus 'sensitive' info won't get eternalized on the internet wink)

Some things to easy my hunting onto what's wrong, please check through these things and send to me smile

* What PunBB version are you using?
* Do you have attachment language files for all languages you're using?
* Did the install_mod.php finish without errors?
* Do your database look like in the documentation textfile found in the zipfile? (use myphpadmin or similar)
* If you delete the cachefiles, and then view a thread on the forum, do the newly generated (common) cachefile contain any attachment variables?

Well that should make for a start, and should give me a pointer of where to look.

Re: Attachment Mod 2.0.1 by Frank H

email sent; not sure what it could be, as I think that most of the answers to those questions yield a good result in the end, so something is messed up somewhere that I don't know. tongue


Re: Attachment Mod 2.0.1 by Frank H

pierce wrote:

Hi, Im setting up a punbb for the first time, and am having a very hard time installing the attachment mod (2.0.1).  It wants 1.2.5, and im using 1.2.12.  I did all the modifications to $punbb_versions, plus fixed some path related errors that it was complaining about, but now at the point where it tries to add a new table to my db, I am stuck.

To deal with this, the documentation
(http://cms.frankh.shacknet.nu/index.php … ;Itemid=32)
suggests "Secondly, step 43 & 44 is altered. Just change the true to false after the query (and add the comment behind , so you have a mark that the attachment mod has altered that line)"

I am not really sure what that means, but the error I get when I try to run the install is this:

File: /var/www/localhost/htdocs/attachmod/install_mod.php Line: 42
PunBB reported: Unable to add table "attach_2_files" to database
Database reported: SQL logic error or missing database (Errno: 1)

here is the code for the query that is failing.
$db->query("CREATE TABLE IF NOT EXISTS `".$db->prefix."attach_2_files` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `owner` int(10) unsigned NOT NULL default '0',
      `post_id` int(10) unsigned NOT NULL default '0',
      `filename` varchar(255) NOT NULL default 'error.file',
      `extension` varchar(64) NOT NULL default 'error.file',
      `mime` varchar(64) NOT NULL default '',
      `location` text NOT NULL,
      `size` int(10) unsigned NOT NULL default '0',
      `downloads` int(10) unsigned NOT NULL default '0',
      UNIQUE KEY `id` (`id`))") or error('Unable to add table "attach_2_files" to database', __FILE__, __LINE__, $db->error());

Does anyone have any suggestions for how to fix this?

Hmm, never seen that before. Did the forum work before you tried to install the mod?
Are you trying to install it on a sqlite? (if so I've written in the first post in this thread that it probably don't work, and noone have come forward to try to help with that either (I don't use it))


Re: Attachment Mod 2.0.1 by Frank H

Ya, it's a fresh install, with a few test posts etc.  Also it is on sqlite.  Looks like ill actually have to dig into the code to fix this one  :-)  Ill keep hacking at it and report my findings here.


Re: Attachment Mod 2.0.1 by Frank H

ah ... if you get it to work I really like to get the fixes so I can incorporate it to the mod.

(the documentation should have a decent description on what the tables should look like)

Re: Attachment Mod 2.0.1 by Frank H

I'd like to thank you very much for this mod. Although I must say that I don't like how you've set it up: you must add permissions for EVERY user group AND for EVERY forum... That's quite alot in my case: more than 100 permissions to set.... A nogo, that is. I noticed this only AFTER I had installed it, so can't write it myself quickly...

That's a disappointment. I suppose you won't mind if I'd submit here the code to add the ability to set global permissions and THEN add exceptions? It won't be for today anyway...

Yet Another Happy PunBB Admin!


266 (edited by Frank H 2006-08-16 20:33)

Re: Attachment Mod 2.0.1 by Frank H

I think there were one of the russian people on this board that did an updated plugin for the mod, perhaps you can use his plugin?
(I think it might be located in the first few pages of this thread)
Edit: I think it was Dexus that made some modifications to the plugin for easier handling

(I will make a better handling of permissions in the mod for PunBB1.3, but for this one I'll probably only make security patches)

267 (edited by Bâshrat the Sneaky 2006-08-17 15:39)

Re: Attachment Mod 2.0.1 by Frank H

Of course, not a problem wink I won't change your system either, as it allows every setting to be set in as much detail as you could wish. I will just allow the user to set permissions for a whole range of forums simultaneously...

And searching for that post by Dexus now...

EDIT: the first pot I found of Dexus was some sort of fix. But then I noticed that your mod adds an additional query for EACH post in a topic. That's too much for me... So I'll skip this mod after all!

And... I really want punBB 1.3! tongue It will making mods so much easier...

Yet Another Happy PunBB Admin!


268 (edited by Frank H 2006-08-17 16:19)

Re: Attachment Mod 2.0.1 by Frank H

yep, that will be fixed aswell in the mod for punbb 1.3 wink

Re: Attachment Mod 2.0.1 by Frank H

Frank H wrote:

yep, that will be fixed aswell in the mod for punbb 1.3 wink


I really need PunBB 1.3 big_smile tongue

Yet Another Happy PunBB Admin!



Re: Attachment Mod 2.0.1 by Frank H

I have a problem, i dont know what it is.

Ive installed it, changed all the files. But when i try to upload  file a wont get a error message and wont be added to attachment directory and punbb wont say there is any attachment. It seems like its doing nothing. But when i select a 1mb file, its taking a while before continue. So it is doeing something. But i dont know where he leaves the file. Hope someone could help

And could someone upload a completed x.12 version with attachment mod added, so i can check if i didnt do anything wrong.



Re: Attachment Mod 2.0.1 by Frank H

Have you followed the installation guide I've made at http://cms.frankh.shacknet.nu/ ?
Especially the part about testing and setup of the mod


Re: Attachment Mod 2.0.1 by Frank H

Hello, I have a same problem as you discussed here...

File: /www/doc/www.vlci.org/www/install_mod.php
Line: 117

PunBB reported: Unable to copy .htaccess file to new subfolder with name '/www/doc/www.vlci.org/home/attachments/d9811d52c73e11f35e2f1e8659bc472a'

attach_func        if(!mkdir($pun_config['attach_basefolder'].$newfolder,0777))
install_mod        if(!mkdir($basepath.$newfolder,0777))

created folder chmod 0750 (still)

Can you help me?

273 (edited by Frank H 2006-09-13 16:28)

Re: Attachment Mod 2.0.1 by Frank H

I have emailed you smile

Edit: and the issue has been resolved, a server configuration interferred with the installscript.

Re: Attachment Mod 2.0.1 by Frank H

well i've followed the manual again, and i think my apache/php configuration is ok. I can upload files with php, i have all write access.

Could someone please upload a zip with a modified punbb forum which works at his/her configuration.

thanks a lot.


Re: Attachment Mod 2.0.1 by Frank H

please email me with more information (I think it's easier to solve over email)

What you've done (according to the installation guide), where it fails, and what it does when it fails.