Recover file from input file bootstrap [duplicate]

0

Is there any difference in time to recover the Input File file in Bootstrap for common HTML? I am using the following code:

and retrieving / printing on the other page with echo $ fileSize = $ _FILES ['file'] ['size'];

I tried both with GET and POST and got the same error as

Undefined index: file in ...

I use the same code in another project without the bootstrap and it works normally, does anyone know what may be happening?

NOTE: The other parameters I retrieve normally, only the input that gives error.

    
asked by anonymous 25.07.2016 / 18:12

1 answer

0

Are you defining enctype as multipart / form-data to allow file upload? Example:

<form action="foo.php" method="POST" enctype="multipart/form-data" class="form-horizontal" role="form">

To recover using php you can use:

$meuArquivo = $_FILES['arquivo']['name']

Where should be what is inside name in form .     

25.07.2016 / 19:26