Sending a path to a FILE control ( it has to be possible! )

C

CHIN@KD

Hi all.. here s my problem ( maybe some of you saw me on other groups, but i
cant find the solution !! )


I have to upload a file to an external site, so, i made a .vbs file , that
logins to the site, and then i have to select the file to upload.. i used
sendkeys.. and i worked perfect.. BUT ... the computer must be locked for
security ( obviusly ) reazons.. so..i think this probable solutions to
unlock the computer and run the application .. or find
another way to fill the FILE control on that site...

- I read some groups, and i found a SendMessage() function, that sends
characters to an especific application, but dont know wich language is it...
and if it runs on a locked computer.
- I can do the click on BROWSE button, but how can i select a file on the
browse window ? ( without using SENDKEYS ) .. i can do a VB6 application
that runs the URL in a webcontrol, but cannot acces to that BROWSER window
right?
- Is there any browser with the security bug that i can write in the VALUE
property of the FILE control?? or is anyway to set that security on
IExplorer?
- .NET .... is there anyway to do this in .NET (ASP.NET or VB.NET) ? i m
begginer but if it could be possible.. i learn .NET in one hour !! lol..


Any idea would be really help here..

Thank you all.
 
P

Patrice

System.Net.WebClient allows to upload a file to particular page. See the SDK
documentation for a sample.

Patrice
 
C

CHIN@KD

Thanx Patrice !!!

But this app works on the Client.. and i dont have access to the server
site... so.. i only can navigate their site and find out how to put the path
on the file control !!!
 
P

Patrice

I'm not sure to have the whole picture. If I understood you are using a web
app that let's you upload a file. Instead of doing this yourself you would
like to have an app doing this for you ?

You have nothing to change or do server side. You'll have a client side .NET
app that uses System.Net.WebClient to post a file to the server side page.
You could also ask them for possible alternate methods (they may have FTP
access ?)

Patrice
--
 
C

CHIN@KD

I have to do a batch process that replaces a guy and his clicks .. lol

there is no way to change or access the remote side code.. and no other way
to do that loggin the page and posting the file..

the page is like hotmail, u log in.. select New Mail.. attach a file .. and
then have to select the file... with System.Net.WebClient, can i emule all
that? .. is possible the website knows if the file comes from
System.Net.WebClient or from their form ?

sorry for my english :p i m posting in japanesse groups !!! lol

Thnx
 
C

CHIN@KD

Another question: if i log in a site.. and put the page in an object ,
modify some controls of the form... and submit again that page to the
server.. how the server knows when i changed a file control for a text
control????

tnx.-
 
P

Patrice

System.Net.WebClient is used client side (NOT server side). It's purpose is
to upload (POST) a file to a particular page. This is done client side...

It should work. Check the documentation for this class and give it a try...

Patrice

--
 
C

CHIN@KD

I M CODING IN .NET RIGHT NOW !!!!

VB.NET or ASP.NET ??.. or it s the same ??


REALLY REALLY TNX !!!
 
K

Kevin Spencer

I M CODING IN .NET RIGHT NOW !!!!
VB.NET or ASP.NET ??.. or it s the same ??

If you have to ask, you might want to study a bit more before you start
coding.

For help with ASP.Net, see the microsoft.public.dotnet.framework.aspnet
newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
K

Kevin Spencer

System.Net.WebClient is used client side (NOT server side). It's purpose
is
to upload (POST) a file to a particular page. This is done client side...

I'm afraid that's just not true, Patrice. System.Net.WebClient is used
server-side in an ASP.Net application. It acts like a browser, sending HTTP
requests, and receiving HTTP responses. The HTML input type=file form
element is used for uploading files on the client. The server-side ASP.Net
Control that creates the file upload form field on the client is
System.Web.UI.HtmlControls.HtmlInputFile.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
K

Kevin Spencer

You would need an ActiveX control or Java applet to do this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
K

Kevin Spencer

For help with ASP.Net, see the microsoft.public.dotnet.framework.aspnet
newsgroup.

Pardon me. Thought I was in a different newsgroup!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
P

Patrice

As long as you have .NET framework installed you can use
System.Net.WebClient either client or server side). In this case, he'll need
to use this client side. This is sometimes used server side to issue a
request to a third party web server from your own server...

HtmlInputFile creates an HTML tag in an HTML page that let the user select a
file. This selected file is then posted to a server side web page that
handles the incoming file and can then save this file.

Similarly to what a browser does, System.Net.WebClient allows to post a
file using the same mechanism used by a browser (this is defined in a RFC).
As this is the same mechanism, the server side page will be able to process
this file as if it was posted using a browser.

Hoping to be a bit more clear...

Patrice

--
 
K

Kevin Spencer

Ah, that makes sense! Sorry to question your logic, Patrice.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
C

CHIN@KD

Tnx Kevin... i can install framework on the client, but i have to post the
file to the https url , it is possible with System.Net.Webclient ?
 
K

Kevin Spencer

Yes, if you use it in an embedded .Net Windows Form in the page.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
C

CHIN@KD

Yes, i just try to acces a page with System.Net.Webclient , simple.. and
done...
i have to login on the site frist.. so i imagine that i have to put a
webcontrol ( in VB6 was that name ) and navigate it right?

and i have to post the user and the pass to the ACTION of the form .. right?

m i on the zone?? lol

tnx
 
K

Kevin Spencer

I'm not following you. The Windows Form that you embed in the page doesn't
need to do anything with the WebForm it resides in. It just has to display
the dialog box, create the WebClient, and send it to its destination. If a
POST request is needed, the WebClient can do a POST.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
C

CHIN@KD

Sorry , i m a jerk, in know..

i m newbbie at .NET and i have to do it for yesterday... lol..

ok, so i have to create the WebClient object, get the URL , log in that page
( i think just do the post to the ACTION on the login form ), and then post
the file..

right??

thnx again !!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,177
Latest member
OrderGlucea
Top