What extensions are supported by $ _FILES?

1

On my system the user can include files within a comment. The problem is that some file extensions are giving error (eg gave error in an Excel worksheet).

I would like to know if you have to configure it to save all types of files or if this is a limitation and so I will create an error handling due?

What I've already tried:

I searched the PHP documentation and right here at Stack Overflow but I did not find anything about it.

  

Note: I do not need a code to clarify just the   variable $ _FILES.

    
asked by anonymous 21.11.2017 / 14:01

1 answer

2

As already stated in the comment and can be seen in a response in the Stack Overflow , PHP does not limit any files, or extensions , or mime type , " naturally ", after all a file is information only. You validate for the user to choose the desired format.

What happened was an error related to the upload size, which exceeded the configured directives, as yourself said . You can confirm that each returned code means this documentation link .

When you have the superglobal $_FILES['error'] with value 1, it is written:

  

Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

What a free translation would be:

  

Value: 1; The file loaded exceeds the upload_max_filesize directive in php.ini.

To make the change, go to php.ini and make changes as needed, in this line, which controls the maximum size allowed for uploads :

upload_max_filesize = 40M

After modifying the php.ini file, you need to restart your HTTP server to use the new configuration.

    
21.11.2017 / 16:18