i have an input type file where i put into a variable in javascript where i want to manipulate the files.
HTML:
<input class="file" id="file1" name="uploadedimages[]" type='file' multiple/>
JavaScript:
var upload = document.getElementById('file1');
upload.files.splice(idtoremove,1) //not working
how can i delete a specific item in upload variable?.I have search that input type file is a readonly and you cannot manipulate it unless you put it to an array and upload the files with ajax.
im doing this for upload to my gallery. first i select multiple images. then there will be a preview first for the pictures before uploading. there will be also an option to remove a photo. my problem is. how can i delete that photo file in input file. so the possible solution is to store input file to array then delete what photo you want in the array then create a formdata for the array and upload using ajax
Question&Answers:os