This is a multi-part message in MIME format.
------=_NextPart_000_0012_01C484AE.304460A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 =3D <path_to_file> =
has no effect, value <INPUT type=3Dfile...> 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 =3D new SHDocVw.InternetExplorerClass();
object o =3D 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 =3D (mshtml.HTMLDocument)ie.Document;
mshtml.IHTMLInputFileElement file =3D =
(mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);=
file.value =3D m_sPathToFile; // has no effect!!!!!!!
mshtml.HTMLInputButtonElement btn =3D =
(mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0)=
;
btn.click();
........................
Thank you for any help
Evgeny
------=_NextPart_000_0012_01C484AE.304460A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi ALL.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I need to simulate send POST data =
( -=20
file upload) as it was submitted in Browser. In C# I create =
instanse=20
of IE, navigate to page with the form, fill in the fields and try to =
Submit by=20
call submitButton.click() Unfortunately it does not work while =
file_filed.vale =3D=20
<path_to_file> has no effect, value <INPUT type=3Dfile...> =
cound not=20
be set from script of that HTML page. Is there another way to set that =
value by=20
means of .NET ? Below the part of code :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<P><FONT face=3D"Courier New" size=3D2>SHDocVw.InternetExplorer ie =3D =
new=20
SHDocVw.InternetExplorerClass();<BR></FONT><FONT face=3D"Courier New"=20
size=3D2>object o =3D null;<BR></FONT><FONT face=3D"Courier New" =
size=3D2>ie.Navigate(=20
url, ref o, ref o, ref o, ref o ); // navigate to page with the form and =
waiting=20
for DownloadComplete<BR></FONT><FONT size=3D2></FONT></P>
<P><FONT size=3D2><FONT=20
face=3D"Courier =
New">.............................................<BR></FONT></P></FONT>
<P><FONT face=3D"Courier New" size=3D2>mshtml.HTMLDocument doc =3D=20
(mshtml.HTMLDocument)ie.Document;<BR></FONT><FONT face=3D"Courier New"=20
size=3D2>mshtml.IHTMLInputFileElement file =3D=20
(mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);=
<BR></FONT><FONT=20
face=3D"Courier New" size=3D2>file.value =3D m_sPathToFile; // has no=20
effect!!!!!!!<BR></FONT><FONT face=3D"Courier New"><FONT=20
size=3D2>mshtml.HTMLInputButtonElement btn =3D=20
(mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0)=
;<BR></FONT><FONT=20
size=3D2>btn.click();</FONT></FONT></P>
<P><FONT face=3D"Courier New" =
size=3D2>........................</FONT></P>
<P><FONT face=3D"Courier New" size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Thank you for any help</FONT></P>
<P><FONT face=3DArial size=3D2>Evgeny</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0012_01C484AE.304460A0--