Hello,
I have a user registry where you can insert a profile photo. Each time I try to insert an image, messages are displayed. I have tried some solutions from the internet but unfortunately I could not solve my problem.
Messages:
Warning: move_uploaded_file (): The second argument to copy () function can not be a directory in
Warning: move_uploaded_file (): Unable to move
BD:
Name | Type
Image | blob
HTML:
<div class="form-group">
<label class="col-md-4 control-label" for="imagem">Imagem de perfil</label>
<div class="col-md-4">
<input type="file" name="imagem" class="btn btn-success" accept="image/*" >
</div>
</div>
PHP:
$tmpName = $_FILES['imagem']['tmp_name'];
$imagem= $_FILES['imagem']['name'];
$arqError = $_FILES['imagem']['error'];
if ($arqError == 0) {
$pasta = './uploads/';
$upload = move_uploaded_file($tmpName, $pasta);
}
PHP to display the image:
<img src="uploads/<?php=$_FILES['imagem']['name'];?>">