|
-
May 22nd, 2001, 07:23 AM
#1
Thread Starter
New Member
Downloading files off a webpage from within VB
ID like to find out how to download a file from a webpage to my PC using Winsoc. Any ideas?
-
May 22nd, 2001, 11:59 AM
#2
Black Cat
Assuming you already know the basics of Winsock, connect to a web server at port 80 and send the following string:
"GET /page.html HTTP/1.0" & vbcrlf & vbcrlf
The incoming data will be the page. You'll have to keep appending it to a string until the connection closes - the file can come in "chunks". Then strip out the HTTP headers (everything up to and including the first two vbcrlf's), and save it to disk.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
May 23rd, 2001, 01:15 AM
#3
Thread Starter
New Member
What does the folowing mean and what do I need to do o correct it.
This is what I receive when sending the string you suggested.
HTTP/1.0 401 Unauthorized
WWW-Authenticate: Basic realm="FW-1. Reason: no user Server "
Content-Type: text/html
Content-Length: 323
<TITLE>Error</TITLE>
<BODY>
<H1>Error 401</H1>
FW-1 at primaryfw1: Unauthorized to access the document.<BR><BR><LI>Authorization is needed for FW-1.<BR><BR><LI>The authentication required by FW-1 for the user is: <STRONG>unknown</STRONG>.<BR><BR><LI>Reason for failure of last attempt: <STRONG>no user</STRONG>
</BODY>
-
May 23rd, 2001, 07:22 AM
#4
Black Cat
It means you need to send a valid username and password to access the page.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 6th, 2001, 02:25 AM
#5
Thread Starter
New Member
How do I sent the user name etc
How do I sent the user name and password?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|