E
Evgeny Zoldin
Hi ALL.
I need to simulate send POST data ( - file upload) as it was submitted in Browser. In C# I create instanse of IE, navigate to page with the form, fill in the fields and try to Submit by call submitButton.click() Unfortunately it does not work while file_filed.vale = <path_to_file> has no effect, value <INPUT type=file...> cound not be set from script of that HTML page. Is there another way to set that value by means of ..NET ? Below the part of code :
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorerClass();
object o = null;
ie.Navigate( url, ref o, ref o, ref o, ref o ); // navigate to page with the form and waiting for DownloadComplete
..............................................
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document;
mshtml.IHTMLInputFileElement file = (mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);
file.value = m_sPathToFile; // has no effect!!!!!!!
mshtml.HTMLInputButtonElement btn = (mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0);
btn.click();
.........................
Thank you for any help
Evgeny
I need to simulate send POST data ( - file upload) as it was submitted in Browser. In C# I create instanse of IE, navigate to page with the form, fill in the fields and try to Submit by call submitButton.click() Unfortunately it does not work while file_filed.vale = <path_to_file> has no effect, value <INPUT type=file...> cound not be set from script of that HTML page. Is there another way to set that value by means of ..NET ? Below the part of code :
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorerClass();
object o = null;
ie.Navigate( url, ref o, ref o, ref o, ref o ); // navigate to page with the form and waiting for DownloadComplete
..............................................
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document;
mshtml.IHTMLInputFileElement file = (mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);
file.value = m_sPathToFile; // has no effect!!!!!!!
mshtml.HTMLInputButtonElement btn = (mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0);
btn.click();
.........................
Thank you for any help
Evgeny