Click here to Skip to main content
15,905,607 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to read a textfile, which stores the paths and file names of the files to be uploaded. How can the file be read into FileLoad control and make the FileLoad.Hasfile = true? In another words, I want to skip the button click event to browse for the files to be uploaded. Thanks.
Posted
Updated 12-Jan-16 3:22am
v2

You can't do this for security reasons. Imagine if websites could automatically upload files from your file system to their servers.
 
Share this answer
 
Comments
s yu 12-Jan-16 9:38am    
You are right. Thanks.
Browsers abstract the user's file system from your application. That is because internet is not something to be trusted! Websites like yours (no offense!) can take away sensitive and personal data without my permission. Then, I don't know what you would do to my data, sell it to criminals or what-so-ever.

The thing browsers allow is that you can prompt the users to select a file. At any cost, you can force them to select a file and if they do, you can continue otherwise, "gently" show them an error message telling them that they cannot use your service.

But, you cannot write a code that will automatically go into user's file system to get a file. Nothing personal, just some security concerns. :-)
 
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