23 Replies - 936 Views - Last Post: 23 July 2012 - 06:56 AM
#1
external fileupload window, programmically input path and file, then h
Posted 19 July 2012 - 04:14 PM
I'm using c# winform. Using webbrowser.control I have logged into a website and navigated around to a particular section. Now I get to the part where I want to upload a file. I am able to "HIT" the UPLOAD button on this website, and the BROWSE button. A normal FileUpload box pops up...
any idea how I can enter in the path and filename into the box, and hit OK all using code?
I hope I am explaining clear... the pop up window is in front of me, now I want to select the file in code.
Thanks in advance!!
Replies To: external fileupload window, programmically input path and file, then h
#2
Re: external fileupload window, programmically input path and file, then h
Posted 19 July 2012 - 09:17 PM
Here's a few answers to a question about how to do the upload: http://stackoverflow...ipart-form-data
#3
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 05:05 AM
#4
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 05:37 AM
#5
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 06:11 AM
#6
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 07:43 AM
#7
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 07:45 AM
Attached File(s)
-
source.htm (137.07K)
Number of downloads: 44
#8
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 08:23 AM
Anyway, look for the <form> element that encapsulates <input type="file">. The action attribute of the <form> element should contain the URL.
#9
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 08:47 AM
#10
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 08:54 AM
#11
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 09:03 AM
#12
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 09:04 AM
#13
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 09:06 AM
solarissf, on 20 July 2012 - 08:54 AM, said:
Based on what I saw on the .htm, it's just a Javascript validator that brings up that prompt. They don't actually do any AJAX upload of files, so it follows the standard web semantics for file uploads using an <input type="file" ...>. That means it uses the URL from the <form> element. http://wwww.w3school...s/tag_input.asp
Here is the form line:
<form name="form1" method="post" action="FileLoad.aspx?COMPANYNAME=ALL+KEYED+DATA&USERID=X152169" onsubmit="javascript:return WebForm_onsubmit();" id="form1" enctype="multipart/form-data">
This post has been edited by Skydiver: 20 July 2012 - 09:07 AM
#14
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 09:12 AM
FileLoad.aspx?COMPANYNAME=ALL+KEYED+DATA&USERID=X152169
?
And I try and use that in HttpWebRequest?
http://stackoverflow...ipart-form-data
#15
Re: external fileupload window, programmically input path and file, then h
Posted 20 July 2012 - 09:47 AM
You'll also have to unencode that "&".
Something like:
http://makemerichovernight.com/FileLoad.aspx?COMPANYNAME=ALL+KEYED+DATA&USERID=X152169
This post has been edited by Skydiver: 20 July 2012 - 09:48 AM
|
|

New Topic/Question
Reply



MultiQuote





|