Link to home
Start Free TrialLog in
Avatar of Moti Mashiah
Moti MashiahFlag for Canada

asked on

automate upload files javasctipt

Hi Guys,
I have a web application asp.net mvc.
I would like to know if is it possible to upload files automatically from source path on the hard drive:
Let me give you an example:

Lets say I have this these code:
and I return 3 paths of img source and created them on the dom:
 for (let i = 0; i < files.length; i++) {
            $("#ImagesReturn").append('<img style="display:none" src="' + files[i] + '"/>')
        }

Open in new window


Here I got the html on the dom:
 <img style="display:none" src="D:\FIles_test_for_new_viewer\AddPages\2.PNG">
<img style="display:none" src="D:\FIles_test_for_new_viewer\AddPages\1.PNG">
<img style="display:none" src="D:\FIles_test_for_new_viewer\AddPages\3.PNG"></div>

Open in new window


now what I want to do is to upload these 3 paths to the server automatically:
Like loop:
var listOffiles = $("#ImagesReturn img");
        for (let i = 0; i < listOffiles.length; i++) {
            //here I would like to get the [b]files[0][/b] like I click on <input type="file">
        }

Open in new window


There is a way to do something like that? if not please let me know your ideas.



Thank you.
ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Moti Mashiah

ASKER

Thank you David.
I don't see any other choice other implementing this concept in the backend.