You are not logged in. Please login or register.


Post new reply

ochiba forum → Support → Maximum file size 0 MB → Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode

All fields with bold label must be completed before the form is submitted.

Required information for guests


Required information

(delete this if you are not)

Topic review (newest first)

10

Hey, much better now! :)
It throws the "No file upload detected ..." error.
Well done.

9

Hmm, see if this works for you

--- release/ochiba-1.1/includes/post.php      2006-01-07 11:40:39.000000000 -0800
+++ includes/post.php   2007-01-28 13:01:49.000000000 -0800
@@ -110,6 +110,8 @@
                 $page->fail($ERRORS["restricted"]);
             }
         }
+    } else if ($_FILES['file']['name'][0] && !is_uploaded_file($_FILES['file']['tmp_name'][0])) {
+        $page->fail($ERRORS["emptyreject"]);
     }
 
     // Quit now if errors ...

8

This can lead to odd posts, where somebody comments on a nonexistent picture he meant to upload but was rejected.

7

Sorry, my mistake. It's not related to the MB/KB.

Sometimes I get a warning:
"No file upload detected - please make sure your post wasn't empty and that you didn't exceed the maximum file size for upload (512000 bytes)"
That happens only if there was no comment in the post it seems.
If there was a comment it just posts that comment. And that was where I missed that warning. But it shouldn't post at all I think because obviously something went wrong and the outcome won't please a user who tried to upload. If he just wanted the text he could just post text after all.

6

There isn't a warning- there's no way for the pre-submit checks to get at the size of the file, so it will post anyway. Once it hits the server, there should be some sort of error- something I fixed in 1.1 I thought.

5

I changed it to KB but now it doesn't realise when the image is to big anymore. It seems to try to upload the image then just makes the post without the image. No warning, no nothing. :/

Works with decimal fractions of MB though "0.5 MB" looks a bit silly. I want KB!

4

Oops, thanks.

3

Thank you. I'll try this out.

EDIT: Yeap, works good. I also changed templates/post.tmpl to read KB now.



Something I just noticed:
In the Readme it says:
   /mods
           Moderator features are available here: managing bans. To access ...

While the real adress is /mod
Didn't want to make a new thread for this.

2

In includes/post.php, line 406, change this:

        $vars["max_bytes"] = round(MAXIMUM_SIZE/1024/1024);

to this:

        $vars["max_bytes"] = number_format(MAXIMUM_SIZE/1024/1024,1);

This will give you precision to the tenths (ie "0.5"). If you change that last number from 1 to 2, you get hundredths (ie "0.50"), etc.

If you want to change it to KB, then change it to:

        $vars["max_bytes"] = round(MAXIMUM_SIZE/1024);

and then change the display line in templates/post.tmpl where it specifies "MB" to "KB".

1

When I set in conf.php
define("MAXIMUM_SIZE",500000);        // bytes
it shows the file size as 0 MB on the board.

How can I show it either as 0.5MB or in KB?

ochiba forum → Support → Maximum file size 0 MB → Post new reply



Generated in 0.016 seconds (71% PHP - 29% DB) with 9 queries