.net browsercomponent with upload function?
i have a program which automates the filling in of a form, i used setattribute and invokemember("onchange") and invokemember("click") for this, and i also need a way to upload a file automatically,
the website contains a button.
when it is clicked, a flebrowserdialog opens and i have to manually select the file to upload
using the standard browsercontrol there is apparently no way to bypass the openfilebrowser window to upload the file,
i need some browsercomponent which allows me to upload the file without me having to manually search the file in the filebrowserdialog
does annyone know of a browsercomponent for .net which allows you to upload files and still allows to trigger onchange and click events??
Re: .net browsercomponent with upload function?
You're looking at this from the wrong direction. The upload is handled entirely by the web server. You can't just throw a file at the page and expect it to be uploaded so no, there is no such component. If you are able to obtain the necessary permissions it might be possible to use ftp but it's unlikely if the site has its own upload protocol. It might also be possible to select a file automatically using the standard dialog from the webpage.
Re: .net browsercomponent with upload function?
Quote:
Originally Posted by
dunfiddlin
You're looking at this from the wrong direction. The upload is handled entirely by the web server. You can't just throw a file at the page and expect it to be uploaded so no, there is no such component. If you are able to obtain the necessary permissions it might be possible to use ftp but it's unlikely if the site has its own upload protocol. It might also be possible to select a file automatically using the standard dialog from the webpage.
if there's no such component, there must be some other way around this
i just need to automate the selecting of the file
i found some examples of it, they are basically the same but in c#, i have never used c# so i can't just convert it into vb code
this is the example
http://www.codeproject.com/Articles/...WebBrowser-com
does annyone know how to do this in vb.net??
Re: .net browsercomponent with upload function?
Quote:
there must be some other way around this
Must there? Does it not occur to you that the site administrator might just be keen on preventing you from doing this and will have made every effort to prevent it? If it is possible then the solution will be entirely dependent on the individual page so unless you're prepared to reveal the site in question there's really not much anybody can do to help.
Re: .net browsercomponent with upload function?
the website i'm talking about is
http://support.z8games.com/webform_new.aspx?gid=
but since none of you probably has an account to login i'll upload the website's HTML
http://www.mediafire.com/?oghwjn3f0wbiw5r
the html code for the upload button is
[code]
<td align="left" class="style4" valign="middle" >
<span id="ctl00_ctl00_Main_Left_lblAttachment">Attachment</span>
(Max. file size = 32MB)
<input type="file" name="ctl00$ctl00$Main$Left$fu_attach_new" id="ctl00_ctl00_Main_Left_fu_attach_new" />
</td>
[code]
Re: .net browsercomponent with upload function?
the upload is without immages and background but that's no porblem i guess
Re: .net browsercomponent with upload function?
i just need to automate the selecting of the file instead of manually selecting it useing the filedialogue
Re: .net browsercomponent with upload function?
Well, as it's a standard dialog, what about using SendKeys with the complete file address and then ALT + O?
Re: .net browsercomponent with upload function?
Quote:
Originally Posted by
dunfiddlin
Well, as it's a standard dialog, what about using SendKeys with the complete file address and then ALT + O?
apparently the sendkey's are also blocked to use with filebrowserdialog
Re: .net browsercomponent with upload function?
Re: .net browsercomponent with upload function?
FileBrowserDialog from the web browser control, i have found, is modal, meaning your application is going to sit and wait until that screen is handled. I have seen some third party stuff online to handle the window when it occurs, but youll have to dig around a bit. If you want to convert c# to vb.net for free you can use:
http://converter.telerik.com/