xoops forums

toolsmythe

Just popping in
Posted on: 2007/5/29 8:53
toolsmythe
toolsmythe (Show more)
Just popping in
Posts: 34
Since: 2004/11/27
#1

Newbb Uploads Failing

I'm trying to upload an mp3 file via the upload facility within newbb. I've set the valid file extensions to '*' and bumped the max file size to 9999999. When I try to upload the file, it spins its wheels for a while and eventually gives me this:

Thanks for your submission!

Errors Returned While Uploading
No file uploaded

If the page does not automatically reload, please click here


The upload directory specified for newbb id readable and writeable.

Any thoughts would be appreciated.

Thanks.

JP

Anonymous

Posted on: 2007/5/29 10:03
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#2

Re: Newbb Uploads Failing

Quote:
toolsmythe wrote:

I'm trying to upload an mp3 file via the upload facility within newbb.


Maybe your host doesn't allow the uploading/hosting of certain file-types?

IMHO, Forums are meant for chatting and looking at pictures, so I've restricted my users to .jpg and .gif files only. Bit less risky that way, too

toolsmythe

Just popping in
Posted on: 2007/5/29 15:10
toolsmythe
toolsmythe (Show more)
Just popping in
Posts: 34
Since: 2004/11/27
#3

Re: Newbb Uploads Failing

Thanks for your response.

In this case, it's my server; I'm the host. The site is *VERY* restricted; I'm in a band and it is for use by band members only. The forum is for notes on the songs that we have in our repitoure. I'm trying to create a knowledge-base so that as band members come and go the band lives on. Hmmm. maybe an FAQ module is more appropriate.

Anyway, I've placed no restrictions on the type of file that may be uploaded (at least none that I'm aware of).

JP

toolsmythe

Just popping in
Posted on: 2007/6/2 16:11
toolsmythe
toolsmythe (Show more)
Just popping in
Posts: 34
Since: 2004/11/27
#4

Re: Newbb Uploads Failing

OK, I have the upload of large files working.

For anyone that is interested, here's what you have to do:

First - and I'm not sure this was really a problem, but it's always a good idea - I upgraded to the latest stable release of CBB (as of this post, 3.08). This was not as easy as I had hoped. I have a cloned template set and for some reason the clone was broken after the upgrade, so it looked like all my forums were gone when I went to the forum page. I recall seeing something a long time ago on that topic and how to fix it, but I only have a couple of minor template changes so it was easier just to create a new clone and duplicate the changes.

Even after that, there was a CBB block missing on the main page. I had to de-activate and reactivate the block in Admin and it came back.

Next, each forum has a setting called "Max Size in kb`s". You will need to bump the size of that up to whatever you think is a reasonable limit. Be aware: this setting is stored in a table called xoops_bb_forums in a column called attach_maxkb. That column is defined as an unsigned smallint (a new change with v3.08). This means you have a limit on the value that field holds of 65535, which means you have a CBB imposed limit of just under 64 Meg. If for some insane reason that is not big enough for you, then you will have to alter the data type for that table to something large enough to suit your evil purposes.

You set the "Max Size in kb`s" at the individual Forum level, so you will find it by editing a Forum in the Admin. While you are in there, you should make sure that the allowed file extensions are suitable to your needs and adjust them if not. A '*' in this setting will remove all file extension restrictions.

I did all that, and I still couldn't get anything larger than 2M to upload; it would *LOOK* like it was uploading, but when the page finally refreshed, there was no attachment. And here is the final hurdle ....

Limits Defined in PHP.
The upload functionality in CBB uses a PHP function called move_uploaded_file(). If you go look at the discussion attached to the documentation on this function over at www.php.net, you will see that there are some settings in PHP that constrain file upload sizes. The two settings in particular that must change in this case are upload_max_filesize and post_max_size.

You probably *DON'T* want to change these in php.ini as this is a very specialized case and you probably want the default for these in most cases. But in this instance, the value for these settings are going to have to go up. These settings cannot be programtically overridden at runtime, so forget about hacking upload.php. You *CAN* however, override them with directives in an .htaccess file in your XOOPS directory. So, if you want to bump the limit up to 50 meg, you would create an .htaccess file (or add to an existing one) as follows:

<IfModule mod_php4.c>
php_value upload_max_filesize 50M
php_value post_max_size 50M
</IfModule>


The above assumes you are running PHP4 and will bump your limit up to 50 Meg.

I uploaded a 7 Meg file with no other mods than what I've outlined above. The discussion of move_uploaded_file() also talks about possibly having to bump up max_input_time and max_execution_time. My upload ran about 1.5 minutes and I did not have to touch either of those; your mileage may vary. There was also discussion about possibly needing to bump up memory_limit. I didn't have to for my 7 Meg file. There is not a whole lot of doc on php.net on memory_limit. I did find this. The default is 128M; be *VERY* careful messing with it.


There are probably dozens of reasons why none of this is a good idea, but if you have a limited number of users, control of your server and you really need it, well, there you go ......

carpino

Just popping in
Posted on: 2007/12/4 5:06
carpino
carpino (Show more)
Just popping in
Posts: 16
Since: 2006/6/20
#5

cbb downloads Failing

i experienced an error 500 downloading the attachments. i thought what you did could solve it, so i tested on my xammp.. but all i needed to do was to set this value to true in newbb/include/plugins.php

around line 55 look for

$customConfig["download_direct"] = true;


im using cbb 3.08

hope this could help anybody...