PHP / AJAX image upload

0

I need to upload a facebook-style image. The user clicks a button, selects the image and clicking OK in the Windows dialog, the image is sent automatically.

Ialreadyhavethefollowingcodes:

$('.trocar_foto').click(function(){
					$('#img_config input[type=file]').trigger('click');
});

				
<form enctype="multipart/form-data">
<input type="file" name="trocar_foto" style="display:none"/>
<button class="trocar_foto" type="submit">Alterar foto</button>
</form>

I do not know how to proceed, because I have never worked with it.

    
asked by anonymous 13.06.2018 / 21:19

0 answers