Recover File Input from Bootstrap File

Asked

Viewed 312 times

0

Is there any difference in the time of recovering the Input File in Bootstrap for common HTML? I’m using the following code:

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

I have tried both with GET as by POST and gives the same error of

Undefined index: file in...

I use the same code in another project without the bootstrap and it works normally, someone knows what might be happening?

OBS: the other parameters I recover normally, only the input that error.

1 answer

0

You are defining the enctype as Multipart/form-date to allow file uploading ? Example:

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

To recover using php can use:

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

Where ['archive'] must be what is inside name="" in the form.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.