I'm writing a client that will navigate a web site by populating the controls. One of the pages accepts both text box data AND requires a file to be uploaded.

Posted on 2006-07-06
Last Modified: 2010-04-23
In VB.NET how can I update a multipart form to contain both text and a file to be uploaded to a web site. I have no control over the website.
Question by:lrygiel
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 96

Expert Comment

by:Bob Learned
ID: 17055258
What is the web site?


Author Comment

ID: 17058234
It is a state judicial web site whihc allows electronic filing of documents. I am at a roadblock at the actual upload filing page. It has a multipart form (created via java scriptlets) containg several file controls and several other controls (text, check box). all wich need to be populated.

So I need to populate the text and check  boxes as well as upload the file. Ideas?
LVL 96

Expert Comment

by:Bob Learned
ID: 17058785
I have used a WebBrowser control to pull up the page, get references to the controls, fill in data, click buttons.

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.


Author Comment

ID: 17059215
Hi Bob,

Are you refering to the old INET control or old web browser control or is  there anything new in .net that is available?

Can you provide an example of the code which will do this?

LVL 96

Expert Comment

by:Bob Learned
ID: 17059299
1) .NET version?

2) Yes, the WebBrowser is still a bigger player in the .NET arena.

3) It depends on the web page, as to whether you can interact with it using the WebBrowser control.

4) 2005 has the WebBrowser control as a managed control, but with 2003 you have to add an unmanaged COM control to the project.

LVL 96

Accepted Solution

Bob Learned earned 250 total points
ID: 17059309
Here is a previous question that should highlight what I mean with 2003:


Author Comment

ID: 17122650

Sorry for the delay in getting back to you, I had another crisis to resolve. Thanks for the help, we are on the right track.

This is .NET 1.1.

I used the WebBroswer control only to discover that the FILE control is a READONLY object. However, I did some further searching and found that giving focus to the control and using the SENDKEYS.SEND method, I can bypass the READONLY nature of the control.

I created a class to do this and the code is as follows:

Public Class FCNET
    Public strErrorMsg As String = ""

    Public ReadOnly Property ErrMsg() As String
            Return strErrorMsg
        End Get
    End Property

    Public Function SetInputValueNET(ByRef vInPut As mshtml.HTMLInputElement, ByVal newValue As String) As Boolean
        Catch ex As Exception
            strErrorMsg = "SendKeys.Send error: " & ex.Message
            Return False
        End Try
        Return True
    End Function
End Class

Seems to do the trick....

Again thanks....



Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question