468,761 Members | 1,759 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,761 developers. It's quick & easy.

download file by post data to web server

BiT
Hello,

I'm working right now on project in vb.net 2005 for my company, i need the
project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve my
problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to do it
i'll be grateful

Thanks

May 19 '07 #1
8 2668

see the example i showed here

http://groups.google.nl/group/micros...704b412827a8b8
ofcourse in the case of a binary file you should only use the byte buffer
var

be aware that this example is a true post the values are send in the message
header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get method

regards

Michel
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews.com ...
Hello,

I'm working right now on project in vb.net 2005 for my company, i need the
project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve my
problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to do it
i'll be grateful

Thanks

May 19 '07 #2
BiT
first thanks for the answear

i've tried your code but I keep getting back 417 errors form the server
any idea?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...
>
see the example i showed here

http://groups.google.nl/group/micros...704b412827a8b8
ofcourse in the case of a binary file you should only use the byte buffer
var

be aware that this example is a true post the values are send in the
message header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get
method

regards

Michel
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews.com ...
>Hello,

I'm working right now on project in vb.net 2005 for my company, i need
the project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve my
problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to do
it i'll be grateful

Thanks

May 20 '07 #3
i've tried your code but I keep getting back 417 errors form the server
any idea?

strange ,,,, "failed expectation" i have never encountered this error
myself
maybe you could post your code here , so we can have a look at it
"BiT" <sh********@walla.comschreef in bericht
news:bf******************************@giganews.com ...
first thanks for the answear

i've tried your code but I keep getting back 417 errors form the server
any idea?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...
>>
see the example i showed here

http://groups.google.nl/group/micros...704b412827a8b8
ofcourse in the case of a binary file you should only use the byte buffer
var

be aware that this example is a true post the values are send in the
message header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get
method

regards

Michel
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews.co m...
>>Hello,

I'm working right now on project in vb.net 2005 for my company, i need
the project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve my
problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to do
it i'll be grateful

Thanks


May 20 '07 #4
BiT
Dim web As New System.Net.WebClient()
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes("?getnzb=Get+N ZB&binary%5B%5D=1115165")

Dim res As Byte() = web.UploadData("http://www.newzleech.com/", "POST", d)

the odd thing is i can do it in one HTML code line and it's work perfect:
FORM action=http://www.newzleech.com/?getnzb=Get+NZB&binary%5B%5D=1115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:u4**************@TK2MSFTNGP05.phx.gbl...
>i've tried your code but I keep getting back 417 errors form the server
any idea?


strange ,,,, "failed expectation" i have never encountered this error
myself
maybe you could post your code here , so we can have a look at it
"BiT" <sh********@walla.comschreef in bericht
news:bf******************************@giganews.com ...
>first thanks for the answear

i've tried your code but I keep getting back 417 errors form the server
any idea?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...
>>>
see the example i showed here

http://groups.google.nl/group/micros...704b412827a8b8
ofcourse in the case of a binary file you should only use the byte
buffer var

be aware that this example is a true post the values are send in the
message header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get
method

regards

Michel
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews.c om...
Hello,

I'm working right now on project in vb.net 2005 for my company, i need
the project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve
my problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to do
it i'll be grateful

Thanks


May 20 '07 #5
This wil work ( tested )
Dim web As New System.Net.WebClient()

web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim d As Byte() = {}

Dim byteData As Byte() =
web.UploadData("http://www.newzleech.com?getnzb=Get+NZB&binary%5B%5D=1115 165&",
"POST", d)

Dim oFileStream As New System.IO.FileStream("bytes.nzb",
System.IO.FileMode.Create)

oFileStream.Write(byteData, 0, byteData.Length)

oFileStream.Close()

i have tested this on my system when i double click the bytes.nzb my news
leecher start downloading 15 files of a supervideo called popeye patriotic
popeye 1957

regards

Michel





"BiT" <sh********@walla.comschreef in bericht
news:Rd******************************@giganews.com ...
Dim web As New System.Net.WebClient()
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes("?getnzb=Get+N ZB&binary%5B%5D=1115165")

Dim res As Byte() = web.UploadData("http://www.newzleech.com/", "POST", d)

the odd thing is i can do it in one HTML code line and it's work perfect:
FORM action=http://www.newzleech.com/?getnzb=Get+NZB&binary%5B%5D=1115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:u4**************@TK2MSFTNGP05.phx.gbl...
>>i've tried your code but I keep getting back 417 errors form the server
any idea?


strange ,,,, "failed expectation" i have never encountered this error
myself
maybe you could post your code here , so we can have a look at it
"BiT" <sh********@walla.comschreef in bericht
news:bf******************************@giganews.co m...
>>first thanks for the answear

i've tried your code but I keep getting back 417 errors form the server
any idea?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...

see the example i showed here

http://groups.google.nl/group/micros...704b412827a8b8
ofcourse in the case of a binary file you should only use the byte
buffer var

be aware that this example is a true post the values are send in the
message header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get
method

regards

Michel
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews. com...
Hello,
>
I'm working right now on project in vb.net 2005 for my company, i need
the project to download file from the company web site.
In order to get the file i have to give the site address
http://www.somthing.com and then send to the server post data like
"&d=10202" to get the file.
i've search google and newsgroups but I didn't find anything to solve
my problem, I found this example
http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
understand it.
if anyone know a document or other source code or can explain how to
do it i'll be grateful
>
Thanks


May 20 '07 #6
BiT
Michel thanks alot
and once again thanks
"Michel Posseth [MCP]" <ms****@posseth.comwrote in message
news:ON**************@TK2MSFTNGP04.phx.gbl...
This wil work ( tested )
Dim web As New System.Net.WebClient()

web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim d As Byte() = {}

Dim byteData As Byte() =
web.UploadData("http://www.newzleech.com?getnzb=Get+NZB&binary%5B%5D=1115 165&",
"POST", d)

Dim oFileStream As New System.IO.FileStream("bytes.nzb",
System.IO.FileMode.Create)

oFileStream.Write(byteData, 0, byteData.Length)

oFileStream.Close()

i have tested this on my system when i double click the bytes.nzb my news
leecher start downloading 15 files of a supervideo called popeye patriotic
popeye 1957

regards

Michel





"BiT" <sh********@walla.comschreef in bericht
news:Rd******************************@giganews.com ...
>Dim web As New System.Net.WebClient()
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes("?getnzb=Get+ NZB&binary%5B%5D=1115165")

Dim res As Byte() = web.UploadData("http://www.newzleech.com/", "POST",
d)

the odd thing is i can do it in one HTML code line and it's work perfect:
FORM action=http://www.newzleech.com/?getnzb=Get+NZB&binary%5B%5D=1115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:u4**************@TK2MSFTNGP05.phx.gbl...
>>>i've tried your code but I keep getting back 417 errors form the server
any idea?
strange ,,,, "failed expectation" i have never encountered this error
myself
maybe you could post your code here , so we can have a look at it
"BiT" <sh********@walla.comschreef in bericht
news:bf******************************@giganews.c om...
first thanks for the answear

i've tried your code but I keep getting back 417 errors form the server
any idea?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...
>
see the example i showed here
>
http://groups.google.nl/group/micros...704b412827a8b8
>
>
ofcourse in the case of a binary file you should only use the byte
buffer var
>
be aware that this example is a true post the values are send in the
message header not over the url
in the case of http://www.example.com/justaname.aspx?bla=hello&
where the variabel is bla and the value is hello we talk about a Get
method
>
regards
>
Michel
>
>
"BiT" <sh********@walla.comschreef in bericht
news:K5******************************@giganews .com...
>Hello,
>>
>I'm working right now on project in vb.net 2005 for my company, i
>need the project to download file from the company web site.
>In order to get the file i have to give the site address
>http://www.somthing.com and then send to the server post data like
>"&d=10202" to get the file.
>i've search google and newsgroups but I didn't find anything to solve
>my problem, I found this example
>http://dotnet.mvps.org/dotnet/code/net/#CookieRequest but i didn't
>understand it.
>if anyone know a document or other source code or can explain how to
>do it i'll be grateful
>>
>Thanks
>
>

May 20 '07 #7
if i want to auto click a button which is on a website can i use the
Post system also then?

the button is java coded and its code is like this
<input type="submit" name="submit" value="submit!">

the submit! is the text that is on the button.
I have tried many things, exept the post system cause i dont really
understand it lol
Thx

May 20 '07 #8

No ,, however you can create all the forms parameters collection and send
it like the example i showed here
http://groups.google.nl/group/micros...704b412827a8b8
And if the website is showed in the webbrowser control there might be a
possibility to trigger the submit action

regards

Michel

<th*************@hotmail.comschreef in bericht
news:11**********************@y2g2000prf.googlegro ups.com...
if i want to auto click a button which is on a website can i use the
Post system also then?

the button is java coded and its code is like this
<input type="submit" name="submit" value="submit!">

the submit! is the text that is on the button.
I have tried many things, exept the post system cause i dont really
understand it lol
Thx

May 21 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Vasu | last post: by
3 posts views Thread by Skwish | last post: by
1 post views Thread by theburnetts | last post: by
1 post views Thread by rdemyan via AccessMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.