automate upload files javasctipt

Moti Mashiah
Moti Mashiah used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Consultant & Challenge Subduer
Top Expert 2009
Commented:
No, that would be a huge security vulnerability. However, it might be possible to do that from an HTA or you could install IIS with ASP.Net on your own PC and do that with cURL (at least if you use a Pro version of Windows).

https://community.box.com/t5/Platform-and-Development-Forum/Upload-files-using-VBScript-with-cURL/td-p/25779
https://stackoverflow.com/questions/20045798/auto-upload-a-file
https://stackoverflow.com/questions/4367222/upload-file-programatically

It seems mplungjan knows more about doing this particular task than I do, so you might want to contact him via a direct/private message.
Moti Mashiah.NET Developer

Author

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial