Re: Attachment Mod 2.0.1 by Frank H

hmm, there are 3 things (well more actually) you can check to see the maximum limit. They are all described in Documentation chapter 1.6. You can find these on the phpinfo() page (in the PunBB base administration page, click "show info" next to the php version number)

Well, it could be more stuff as well, like script running times, free memory, etc. , but those I've got less experience with, and what errors they cause in the end when one breaks them.
(googled some, and seems it could be some httpd.conf thingie setting a max upload inside apache)

Re: Attachment Mod 2.0.1 by Frank H


I'm having some kind of problem with this mod:

I installed it (succes) and could attach files normaly. It's working wonderfull. But when attach a .zip file (sucess) and when i try to download it, it just appear the beggining of the .zip source code.... how i manage it to pop up a dialog box to save the file? Is it possible?


Re: Attachment Mod 2.0.1 by Frank H

Giacometti hmm you test on localhost?
If yes go to your apache config(httpd.conf) and find one line:

DefaultType text/plain

Change it to:

DefaultType application/octet-stream

If no, i think hosting upped on windows operation system and u have two chooses, first u can change host, two u send mail to server administrator wink
Sorry of bad english wink


Re: Attachment Mod 2.0.1 by Frank H

that's odd either way, as when I pass through the file I tell what mime the file is ... must be something in the webserver that's messing with the mime ....

Re: Attachment Mod 2.0.1 by Frank H

when you attach an image, like an .png, when you click at it normally it opens a dialog box to save it or it just open the image in a new window? Because in my forum it just open in a new window....


Re: Attachment Mod 2.0.1 by Frank H

images are opened in a viewer ... clicking the filename in the viewer should open up a save as dialogue (unless you've told your browser to do different, or that the webserver is configured oddly)


Re: Attachment Mod 2.0.1 by Frank H

phpbb converter is sent out for testing ... if it prroves to be functional I'll put it on the punres page and post another message

233 (edited by Blakeyrat 2006-02-11 18:07)

Re: Attachment Mod 2.0.1 by Frank H

Hey Frank, thanks a ton for your MOD it's bound to be really helpful as soon as I can get it working.  smile

Here's the problem I have.  Per your instructions, I've filled in the full path to the files directory based on the path given by phpinfo(), which is:


When I click "install", I get the following error:

File: /home/.servername/blakeyrat/domain.com/forum/install_mod.php
Line: 119

PunBB reported: Unable to copy index.html file to new subfolder with name '/home/.servername/blakeyrat/domain.com/forum/files/da3d9666984ab2938a8f4af1b24daa7f'

As you can see, the path given by phpinfo() and the path given by this error message are different... the error one contains an extra folder that I don't see otherwise.  The weird thing is that if I modify the path I enter to include that extra folder, I get the exact same error.  I'm assuming this is the result of some kind of redirection my host is doing?  Is there any way to use a relative path instead of an absolute path?


Just noticed this.  It can create the folder successfully, but it can't write *inside* of the folder.  So it looks like it's a plain old permissions issue.  That said, I still don't know what's going on... the permissions of /files is correct, shouldn't the permissions of folders created inside of it be the same?

The folder created has permissions of 750

Is this a configuration error?  Can anybody help me out here?


234 (edited by Frank H 2006-02-11 18:28)

Re: Attachment Mod 2.0.1 by Frank H

hmm, some people (somewhere in this 10 page thread, or in the 1.0 version pages wink) have needed to alter the rights set for the newly created subfolders to 777, to do this you need to edit install_mod.php (line 113) and search for 0750 and replace it with 0777 and also edit include/attach/attach_func.php (line 127) and change the 0750 to 0777 there aswell.

hopefully it will work then smile

235 (edited by Blakeyrat 2006-02-12 17:03)

Re: Attachment Mod 2.0.1 by Frank H

Unfortunately, I'm still having the problem.  The permissions of the created folders are still 750.


Re: Attachment Mod 2.0.1 by Frank H

and you remembered to upload the files and re-run install_mod.php?

(it won't change the existing folder, but when a new one is created it will get that chmod instead)


Re: Attachment Mod 2.0.1 by Frank H

It shows the following error msg.....

You are running a version of PunBB (1.2.10) that this mod does not support. This mod supports PunBB versions: 1.2, 1.2.1, 1.2.3, 1.2.4, 1.2.5


Re: Attachment Mod 2.0.1 by Frank H

It works now;

have to conf in admin


Re: Attachment Mod 2.0.1 by Frank H

Suggestion for a mod of this mod wink or maybe for a Attachment Mod 3.0.0 big_smile

Did someone try to use the files stored in the attach directory and to display the in a 'Download' pages with a member access?

My idea: each file should have a 'category_id' which will be used by the 'display' page to show the categories and the files inside.

240 (edited by Frank H 2006-03-07 17:15)

Re: Attachment Mod 2.0.1 by Frank H

I made it specially not to direct link to teh attachment directory (unsafe to fetch directly from the directory, as one can figure out the location and distrobute it to people who aren't allowed to view it & also that it's messy to fiddle with temporary files)

But, I suppose it would be possible to make a special page where you can download all those that you're allowed to view, but it feels more like a mod for this mod
(all what's needed is more or less a link in the menu, and a new page that scans through all attachments and checks some permissions for the forums, and that it links to attachment.php to fetch the files)

there's a couple of upload mods aswell, perhaps those are better suited for your needs?

either way, I haven't the time at the moment, as you can see in the sig wink


Re: Attachment Mod 2.0.1 by Frank H

OK I will have a look on ans as well the upload mods, as soon I have some time. But what I like in yours is the idea to have a page where members can find easily all the attached files.
If someone is interesting by this project please let me know in order to find the best way to proceed together !

Frank, all the best for your new job !



Re: Attachment Mod 2.0.1 by Frank H

I cant figure out why this mod works one minute and not the next, is there a sync issue?


Re: Attachment Mod 2.0.1 by Frank H

what fails?


Re: Attachment Mod 2.0.1 by Frank H


Few users and myself have a problem to open a zip file downloaded with IE (with firefox it's ok).
You can test on this file : http://georezo.net/forum/viewtopic.php? … 71#p47671.
It should be ok to unzip it but if you compare the firefox's unzipped and the IE's ones, you shoud see differences. Any idea where this is coming from and how can solve it ?


245 (edited by Frank H 2006-04-03 16:22)

Re: Attachment Mod 2.0.1 by Frank H

lol, that was weird big_smile

hmm, I suppose you're using gzipped output on the page?

(if you rename the unpacked file to be a zip, you can unzip that one and get all the files ... anyhow, I need to test on my forum to see if it's the same ... I'll report back later today)

Crap, happens on my forum aswell if I use gzipped output sad
As a temporary fix, disable the gzipped output in Admin-Options

I'm going to look further into this and hopefully be able to come up with a fix later (oddly enough it is ok with firefox, so I'll see what I need to do ... hopefully just make a small change inside attachment.php smile

246 (edited by Frank H 2006-04-03 16:33)

Re: Attachment Mod 2.0.1 by Frank H

Bug fixed big_smile
(was simpler than I first thought)

<-- 1. OPEN ---------------------->


<-- 2. FIND (line 38) ------------>

define('PUN_ROOT', './');

<-- 3. AFTER ADD ----------------->


<-- 4. SAVE/UPLOAD --------------->


Re: Attachment Mod 2.0.1 by Frank H

So Fast !!!!! Seems good !



Re: Attachment Mod 2.0.1 by Frank H

no problem smile

The only drawback is that it will disable gzip output for all files transfered through attachment.php, for PunBB 1.3 I'll probably fix so that the mod will disable gzip output only on some files, but that would require more changes in more than one file.


Re: Attachment Mod 2.0.1 by Frank H

A French translation is now avaible thanks to Dominique

250 (edited by shuron 2006-04-15 13:57)

Re: Attachment Mod 2.0.1 by Frank H

Skip Wiley wrote:

Hey Frank, thanks again for your great mod. 

Quick question/problem -- on our forum, we're having trouble uploading files bigger than 500k or so.  Everything less than that works fine, but everything more returns some strange "server reset" error.  We have max file size (as set in the mod "settings" panel under admin) set at 20mb (it was recently at 10mb, which gave the same error).  My guess is this has something to do with the actual server itself and not the forum?

If you could shed light on this either way, that would be great.  I am by no means a server expert, but I can get in touch with the webmaster no problem.  I just want to make sure there isnt' a mistake I'm making with the forum.  We're pretty sure we've isolated the problem down to this -- I've triple-checked permissions and tried multiple accounts with multiple files.  Even seemingly erroneous files, when shrunk down to 500k or less, work. 

Any thoughts?  Thanks!

I also have problems with files greather than 500K but at most when I try to upload them with IE 6
Mozila Firefoks performs well.

Server is ok.

I use latest Version of the forum. to instal I added version 1.2.11 in the "supportin versions array"
Any Idea?
i debbuget littelbit with "echo" big_smile

    //Attachment Mod Block Start
        if (isset($_FILES['attached_file']) && 
           $_FILES['attached_file']['size'] !=0 && is_uploaded_file($_FILES['attached_file']['tmp_name']))
            echo "1. Uplodet file recognized "; // My debug routine ;)


So the problem is in these lines.
Sometemise it gives false don't know why. But I suppose the Problem is in IE.

Further i don't see any editing posibility for attachments i the edit Page. Not as admin and not as member
tryed to set some flags in edit.php
like this


does not help

I use PHP Version 4.4.2

Any Idea? Any impruved versions?