Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm currently coding a program that handles images and show a preview before upload them, that preview includes the option of deleting some items of the bunch selected. I've look over it and as far as I've been able to read in posts related to this question is "not possible" and the most viable option was to push the selected files in an array as I did to modify which items could be deleted from the group. My problem lies in how I'm going to upload the remaining files since the items in the file element stays immutable....

I've been learning to by my own and my knowledge is pretty limited in how should I approach this issue so please guys feel free to share how you'd solve this. Thanks for your time as well, I really appreciate it.

here it's kind of what I meant and pretty summed up:

PHP
<input type='file' id='files' multiple/>

function handlefiles(){
// I'm looping through the files and passing them in an array so I be able to edit it
// say the user selects 8 files then deletes 3 of them... I need to put the 5 remaining files in the $("files").val(); push the array in there or whatever the hell works better to achieve what I want
// now say the 5 remaining files are the ones the user wants to upload, the $("files").val() stays in the previous 8, that's my problem.


}

$("#pics").on('change', function(){
        readURL(); // I'm reading the files as a data URL.
    },handlefiles);

I hope I had explained myself, forgive the broken English and greetings from Berlin :)
Posted
Updated 30-Aug-15 3:30am
v2

1 solution

Quote:
My problem lies in how I'm going to upload the remaining files since the items in the file element stays immutable....

If the list is immutable and you can't update it, may be you can reload it the same way you loaded it on first time.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900