473,847 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3009

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********@wal la.comschreef in bericht
news:K5******** *************** *******@giganew s.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.c omwrote in message
news:OO******** ******@TK2MSFTN GP02.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********@wal la.comschreef in bericht
news:K5******** *************** *******@giganew s.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********@wal la.comschreef in bericht
news:bf******** *************** *******@giganew s.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.c omwrote in message
news:OO******** ******@TK2MSFTN GP02.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********@wal la.comschreef in bericht
news:K5******* *************** ********@gigane ws.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 #4
BiT
Dim web As New System.Net.WebC lient()
web.Headers.Add ("Content-Type", "applicatio n/x-www-form-urlencoded")

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

Dim res As Byte() = web.UploadData( "http://www.newzleech.c om/", "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.c om/?getnzb=Get+NZB &binary%5B%5D=1 115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******** ******@TK2MSFTN GP05.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********@wal la.comschreef in bericht
news:bf******** *************** *******@giganew s.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.c omwrote in message
news:OO******* *******@TK2MSFT NGP02.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********@wal la.comschreef in bericht
news:K5****** *************** *********@gigan ews.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 #5
This wil work ( tested )
Dim web As New System.Net.WebC lient()

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

Dim d As Byte() = {}

Dim byteData As Byte() =
web.UploadData( "http://www.newzleech.c om?getnzb=Get+N ZB&binary%5B%5D =1115165&",
"POST", d)

Dim oFileStream As New System.IO.FileS tream("bytes.nz b",
System.IO.FileM ode.Create)

oFileStream.Wri te(byteData, 0, byteData.Length )

oFileStream.Clo se()

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********@wal la.comschreef in bericht
news:Rd******** *************** *******@giganew s.com...
Dim web As New System.Net.WebC lient()
web.Headers.Add ("Content-Type", "applicatio n/x-www-form-urlencoded")

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

Dim res As Byte() = web.UploadData( "http://www.newzleech.c om/", "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.c om/?getnzb=Get+NZB &binary%5B%5D=1 115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******** ******@TK2MSFTN GP05.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********@wal la.comschreef in bericht
news:bf******* *************** ********@gigane ws.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.c omwrote in message
news:OO****** ********@TK2MSF TNGP02.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********@wal la.comschreef in bericht
news:K5***** *************** **********@giga news.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
understan d 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******** ******@TK2MSFTN GP04.phx.gbl...
This wil work ( tested )
Dim web As New System.Net.WebC lient()

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

Dim d As Byte() = {}

Dim byteData As Byte() =
web.UploadData( "http://www.newzleech.c om?getnzb=Get+N ZB&binary%5B%5D =1115165&",
"POST", d)

Dim oFileStream As New System.IO.FileS tream("bytes.nz b",
System.IO.FileM ode.Create)

oFileStream.Wri te(byteData, 0, byteData.Length )

oFileStream.Clo se()

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********@wal la.comschreef in bericht
news:Rd******** *************** *******@giganew s.com...
>Dim web As New System.Net.WebC lient()
web.Headers.Ad d("Content-Type", "applicatio n/x-www-form-urlencoded")

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

Dim res As Byte() = web.UploadData( "http://www.newzleech.c om/", "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.c om/?getnzb=Get+NZB &binary%5B%5D=1 115165
method=post>
<INPUT type=submit value="test" name=getnz>

thanks

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:u4******* *******@TK2MSFT NGP05.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********@wal la.comschreef in bericht
news:bf****** *************** *********@gigan ews.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.c omwrote in message
news:OO***** *********@TK2MS FTNGP02.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********@wal la.comschreef in bericht
news:K5**** *************** ***********@gig anews.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=1020 2" 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
>understa nd 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.comsc hreef in bericht
news:11******** **************@ y2g2000prf.goog legroups.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5904
by: Vasu | last post by:
Hi, I have a requirement to download a file from the web site using a client tool. Iam writing a C# program to download using WebRequest, HttpRequest, WebResponse and so on. The problem Iam having is to navigate thru multiple pages. I have to login
3
2332
by: Skwish | last post by:
Hi, I would like to download all the files from a folder (of various types i.e. ..txt, .dll, .dat, etc.). I tried Dim MyDir As IO.Directory Dim path As String = Me.MapPath(".") & "\Data" Dim dirs As String() = IO.Directory.GetFiles(path) Dim iLoop As Integer Dim FileName As String 'Set the appropriate ContentType.
1
2229
by: Daniel | last post by:
Hi, can u explain to me what is the path need to use in order to upload and download the file based on below solution: 1.Set up a folder that both the web app and SQL server can get to. 2.Do a simple file upload from the web app what is DTS package and how to apply it? 3.Set up a DTS package to periodically check the folder to do an import. Your help will be appreciated.
18
16411
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6)
1
2262
by: theburnetts | last post by:
I am building an ASP.NET application that has a requirement that the user should be able to download all of the data that they have input into the system and save it to a file on their local PC. Then at some future time they should be able to upload it back to the web server and continue working on it. (Don't ask me why they have to be able to do this. Apparently the users are super paranoid about saving their data to the server and...
5
12321
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. On Beta1, I am able to execute a particular page with no problem, that page opens up in the comes up just fine. On Win2kdev1, when I go to execute the same page, it opens a file download dialog and asks me whether I want to open or save the...
1
2724
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the ftp site and gets the file name for any update files on the site. I already have code to do this...
2
6981
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
1
47511
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
10987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10652
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10709
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10343
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9486
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7885
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5914
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4125
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.