function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]); // convert to base64 string
}
}
$("#imgInp").change(function() {
readURL(this);
});
<iframe width="0" height="0" name="iframe"></iframe>
Form for loading images with the select button file:
<form action="/thumbnail.php" method="post" enctype="multipart/form-data" target="iframe">
<input type="file" name="file" id="file" />
</form>
<input type="hidden" name="thumbnail[]" value="123">
id | id_post | file_name | file_date
123 | null | file.jpeg | 20-02-2020
update images set id_post = 1 where id = 123
Find more questions by tags PHP
This is of course solved, but should be some advantage to be here. And I don't see any for the website or for the user.
UPD. Although there are cases, for example when simultaneously downloading 20 images for the user saving will be much faster if these 200MB had already been uploaded in the background and not in POST request to server go. - mortimer commented on April 19th 20 at 12:42
it is actually loaded on hstor.org Ajax and the answer comes filled id of the file
review can not send and picture and will lie dormant
so doing all of that
in the VC if I write a post attach a photo, and then your mind is already flooded with photos remain on the server. - emely_Hagenes commented on April 19th 20 at 12:48