Previous Thread
Next Thread
Print Thread
Hop To
#231422 12/02/2009 5:18 PM
Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
We have the file attachment size set for "6" in our forums, yet when we go to UL an attachment we get the error message:
"We encountered a problem. The reason reported was
Files can be no larger than 1 Bytes bytes."

What are we doing wrong?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
the size is in bytes, so 1Meg would be: 1048576

wink

Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
I am talking about the setting in the control panel and not language file itself.

Forum > Permissions > Maximum Size of file attachments

"If file attachments are enabled in the forum, this dictates how large each file attachment can be. Max size set in php.ini is 10M so you may not exceed this size."

0=off
1=ON

We have it set to 1 or ON but getting the error message.

What is wrong?

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
This is one of those permissions that you'll enter in an actual amount, 1 will turn it on and allow for 1 byte. 1048576 will turn it on and allow for 1 MB.

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
We all get used to the permission settings being 0,1 or -1.
Then we have the very few settings that require a actual value.
This particular setting is even more confusing where the note displays the"If file attachments are enabled in the forum, this dictates how large each file attachment can be. Max size set in php.ini is 10M so you may not exceed this size"

So you would expect to enter a value in MB like 1 or 6.
Where in fact it is a value in bytes you must enter.

Maybe Rick will improve on this visually on V8. Or allow bytes,KB,MB entries to be made.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Well, in version 8, if it's a -1,0,1 now it's going to be an on/off/explicit off select box. All other fields that expect some sort of value will be the only ones that will be text fields that you can type in.

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Okay I understand, but maybe need to edit the language file to add that the value is in bytes. From the stock code.
The screenshot from the changelog did not show a value that could be a variable.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
hmmm.....

I set the file size in one of our forums
Forum Settings > Forum Name > Permissions
for all users to: 10485760

but still get the error:

We encountered a problem. The reason reported was
Files can be no larger than 1 MB bytes.
Please click back to return to the previous page.

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
It probably is due to your php.ini file has limited it to 1MB
you entered 10 mb.
A quick hint is when setting the file size limit in the ubb control panel there is a note that reads the php.ini file and will state what the max size can be. The attachment size will be the lesser of the two settings.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Sorry just re-read your previous post. But anyway double check anyway in case your host changed the max size.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Okay just a thought.
Even if your host has set the php value to 10mb for file size there is another value in the php.ini that limits size.

post_max_size

You can view that setting in the control panel also at cp>>PHP Info.

From the php manual:
Quote
post_max_size integer
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size . When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set.



Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
Our php.ini is set for
upload_max_filesize: 10 M
post_max_size: 10 M
memory_limit: 218 M

Any other ideas why we are getting the error?

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Something is definitely a little funky as that error message doesn't look right at all:

Files can be no larger than 1 MB bytes.

There was a bit of a bug in 7.5.3 and prior where the php.ini was set in bytes it would cause a problem. It looks like that might be the case with yours and it looks like maybe you've put in 1 MB into the max size instead of an actual number like 1048576

Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
Hi Rick,

We have v. 7.5.4.1

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, can you open up a basic support ticket with admin info to the forums so I can take a look at your settings as well as the php.ini file?

Joined: Jan 2004
Posts: 193
S
sb
Offline
member
member
S Offline
Joined: Jan 2004
Posts: 193
IT Director here:

Rick, one point of clarification, memory_limit: 128 M is our setting.

sb wanted me to post about the php.ini configuration I have in place.

The current server runs PHP as a CGI. php.ini settings take affect ONLY for the directory which the file is placed in, not subdirs under that dir. I wrote a quick script to propigate synlinks back to the php.ini in the webroot dir throughout the website subtree, placing symlinks in dirs that have .php files in them. Works great, and phpinfo correctly identifies the correct path of the actual php.ini file. Net result is that now the php.ini file in the webroot affects the settings for the entire site.

Let me know if settings need to be adjusted, I will update the master file, thus updating the entire site, and post a comment/URL referencing why the change was made.

sb is opening a ticket in the admin area.

Thank you!


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (1 invisible), 780 guests, and 174 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240501)