?
Solved

webbrowser problem

Posted on 2001-06-03
8
Medium Priority
?
221 Views
Last Modified: 2008-02-01
I hope someone out there is as twisted as me.

I know the webbrowser control pretty well. or so I thought until now.

<html>
<body>
<INPUT name=PICTURE1_SOURCE size=50 type=file accept="image/jpeg,image/jpg">
</body>
</html>

how do I programtically(from VB) set the value of this box. No .value does not work.



0
Comment
Question by:brookman
  • 4
  • 2
  • 2
8 Comments
 
LVL 5

Accepted Solution

by:
djbusychild earned 600 total points
ID: 6151646
this is really a VB question not a javascript question.

normally you wouldn't be able to since it'd be a security risk for javascript to set that and automatically upload random files from the user.


Now if you're overriding that through your own extended version of the webbrowser control, then you could try querying for the IHTMLDocument2 interface, then run get_forms on the interface, iterate through the IHTMLElementCollection interface you get back through the item() method until you find your file input then run set_value() on it... This is coming from the C++ point of view, I don't speak VB so this could potentially be a hell a lot easier through VB... dunno..

you might even be able to query for the IHTMLInputFileElement interface directly
0
 
LVL 5

Expert Comment

by:djbusychild
ID: 6151648
this is really a VB question not a javascript question.

normally you wouldn't be able to since it'd be a security risk for javascript to set that and automatically upload random files from the user.


Now if you're overriding that through your own extended version of the webbrowser control, then you could try querying for the IHTMLDocument2 interface, then run get_forms on the interface, iterate through the IHTMLElementCollection interface you get back through the item() method until you find your file input then run set_value() on it... This is coming from the C++ point of view, I don't speak VB so this could potentially be a hell a lot easier through VB... dunno..

you might even be able to query for the IHTMLInputFileElement interface directly
0
 
LVL 5

Expert Comment

by:djbusychild
ID: 6151649
oops... sorry I accidentally made that an answer. =(
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:VincentWong
ID: 6153062
This site is quite good. It provides whole source code of the file uploading function with comment. The whole function is written in VBScript and no need to register the com object.

I have used this before and it worked fine.

http://www.aspzone.com/articles/john/aspUpload/

good luck.
0
 
LVL 2

Expert Comment

by:VincentWong
ID: 6153106
You can use this to display the image which is uploaded by user.

<%
If Request.TotalBytes > 0 Then
  Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))
End If
%>

The code is copied from the link in previous comment.
0
 
LVL 5

Expert Comment

by:djbusychild
ID: 6153320
Vincet, I think you're misunderstanding the question
0
 
LVL 2

Author Comment

by:brookman
ID: 6153417
I have had this problem solved.  I ended up doing an object.focus then use sendkeys to fill in the box.
0
 
LVL 2

Author Comment

by:brookman
ID: 6751346
I solved this in a different way but I appreciate your effort.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

862 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