Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17849

Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo

Newsgroups comp.lang.php
Date 2018-12-17 07:01 -0800
References (2 earlier) <89fa34e7-c2fd-4853-8b45-4ecd194fc905@googlegroups.com> <5c14d447$0$22354$e4fe514c@news.xs4all.nl> <1c2f78d9-eb17-4b50-ba74-fdd2f51b333e@googlegroups.com> <5c1517b9$0$22354$e4fe514c@news.xs4all.nl> <g7ln19Fagd9U1@mid.individual.net>
Message-ID <3e6234ed-e98c-44a4-ad84-eaace5216ebd@googlegroups.com> (permalink)
Subject Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo
From Dan Campbell <dcwhatthe@gmail.com>

Show all headers | View raw


On Saturday, December 15, 2018 at 8:11:12 PM UTC-5, Arno Welzel wrote:
> Luuk:
> 
> [...]
> > BTW, i did read this 2 minutes ago:
> > http://php.net/manual/en/features.file-upload.post-method.php
> > posted by Mark, 8 years ago:
> > $_FILES will be empty if a user attempts to upload a file greater than 
> > post_max_size in your php.ini
> > 
> > post_max_size should be >= upload_max_filesize in your php.ini.
> 
> If you read the text at the mentioned URL, you will also find a note
> about how to tell the browser the size limit, so people don't try to
> upload stuff, which is too large:
> 
> <!-- The data encoding type, enctype, MUST be specified as below -->
> <form enctype="multipart/form-data" action="__URL__" method="POST">
>     <!-- MAX_FILE_SIZE must precede the file input field -->
>     <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
>     <!-- Name of input element determines name in $_FILES array -->
>     Send this file: <input name="userfile" type="file" />
>     <input type="submit" value="Send File" />
> </form>
> 
> The __URL__ in the above example should be replaced, and point to a PHP
> file.
> 
> The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file
> input field, and its value is the maximum filesize accepted by PHP. This
> form element should always be used as it saves users the trouble of
> waiting for a big file being transferred only to find that it was too
> large and the transfer failed.
> 
> (quote end)
> 
> And this may help as well:
> 
> <https://stackoverflow.com/questions/2934788/detecting-file-upload-size-on-the-client-side>
> 
> <https://stackoverflow.com/questions/6327965/html-upload-max-file-size-does-not-appear-to-work>
> 
> 
> -- 
> Arno Welzel
> https://arnowelzel.de

Arno,

The HTML injection didn't work.  I set it to a very low figure - a million bytes - while the php.ini was set to 4M.

It didn't prevent the attempt to upload, and did the same thing it would without the hidden input field - set the $php_errormsg variable to 

"POST Content-Length of 4273824 bytes exceeds the limit of 4194304 bytes"


, without specifying which file was too large, and then just didn't do the upload.  Exactly the same as before.


Anyway, I'll code the javascript today, and move on.


Regards,

DC

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-14 12:44 -0800
  Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Luuk <luuk@invalid.lan> - 2018-12-14 22:02 +0100
    Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-14 13:45 -0800
      Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-12-14 17:07 -0500
      Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Luuk <luuk@invalid.lan> - 2018-12-15 11:15 +0100
        Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-15 05:50 -0800
          Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Luuk <luuk@invalid.lan> - 2018-12-15 16:03 +0100
            Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-15 09:42 -0800
              Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Luuk <luuk@invalid.lan> - 2018-12-15 20:01 +0100
            Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Arno Welzel <usenet@arnowelzel.de> - 2018-12-16 02:11 +0100
              Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Luuk <luuk@invalid.lan> - 2018-12-16 14:22 +0100
                Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-16 11:05 -0800
              Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-16 11:02 -0800
              Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-12-16 23:30 +0100
                Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-16 15:15 -0800
              Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-17 07:01 -0800
                Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2019-01-29 07:06 -0800
                Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo bill <william@TechServSys.com> - 2019-01-30 06:43 -0500
  Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Dan Campbell <dcwhatthe@gmail.com> - 2018-12-14 13:42 -0800
    Re: Cannot retrieve error related to a specific file upload, in a 3-part input file blo Jerry Stuckle <jstucklex@attglobal.net> - 2018-12-16 12:45 -0500

csiph-web