Results 1 to 11 of 11

Thread: .net browsercomponent with upload function?

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    .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??

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    Re: .net browsercomponent with upload function?

    Quote Originally Posted by dunfiddlin View Post
    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??

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: .net browsercomponent with upload function?

    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.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    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]

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    Re: .net browsercomponent with upload function?

    the upload is without immages and background but that's no porblem i guess

  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    Re: .net browsercomponent with upload function?

    i just need to automate the selecting of the file instead of manually selecting it useing the filedialogue

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    Re: .net browsercomponent with upload function?

    Quote Originally Posted by dunfiddlin View Post
    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

  10. #10

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    10

    Re: .net browsercomponent with upload function?

    annyone help???

  11. #11
    Frenzied Member
    Join Date
    Oct 2012
    Location
    Tampa, FL
    Posts
    1,187

    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/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width