Is there a way to automate uploading file in a web page using html file input control?

I used a form with a web browser control on it to automate the process of connecting to a website entering the login and password and finish the process of uploading a file.

As you navigate to the upload page i can't get the input file control to work automatically because the value property is read only and here is the code

 

HtmlDocument loginPage = wb.Documanet;

loginPage.All["file1" ].SetAttributes("value", @"C:\A\A.txt");              //this doesn't work

 

Your help is appreciated. 


Mark as an answer if it helps.
0
almargob
3/11/2007 5:13:55 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 5 followers.

💬 3 Replies
👁️‍🗨️ 1122 Views

I dont think you can automate the upload file process in the regular file upload control that ships with asp.net because you can not set the file to the fileupload control its just a read only property.try to search for a third party control which will do the process.

HC


Haissam Abdul Malak
MCAD.NET
| Blog |
0
Haissam
3/11/2007 6:37:05 PM
Hi,

I'm quite agree with Haissam, since such behaviour is a huge security risk to users.
And the browser will try to prevent this from happenning.
0
Raymond
3/14/2007 4:06:22 AM
I think the host is a hacker.
0
guaiguosh
3/14/2007 4:51:01 AM