4
I’m using the Plugin Bootstrap File Input
And it’s returning to me 'Notice: Undefined offset:'
Codes
<input id="file-upload" name="files[]" type="file" multiple>
Form already has the enctype="multipart/form-data">
Post:
$fdata = $_FILES['files'];
$uploads_dir = 'images/';
$img = array();
for ($i = 0; $i < count($fdata['name']); $i++) {
preg_match("/\.(gif|bmp|png|jpg|jpeg){1}$/i", $_FILES['files']['name'][$i], $ext);
$imagem_nome = md5(uniqid(time())) . "." . $ext[1];
$temp_name = $_FILES['files']['tmp_name'][$i];
move_uploaded_file($temp_name, "$uploads_dir"."$imagem_nome");
$img[] = $imagem_nome;
}
This is the Upload.
Even giving an echo in:
echo $_FILES['files']['name']['0'];
Nothing appears
I made the changes you sent and I realized that when selecting the images from the windows window that opens when the button is pressed, the images are sent in the Post, but if I drag the images into the Input, the Previews are generated, but, the images are not sent in the Post
– sNniffer
@sNniffer capable of D'n’D only work with Ajax in this plugin. I’m not sure, but there is this possibility.
– Bacco
I’ll give a look at the documentation, thanks for the reply
– sNniffer