Solved

Downloading HTML pages from internet

Posted on 2003-12-11
11
1,337 Views
Last Modified: 2013-11-13
Hi pals,
I am working on a small project which consists of making a download manager. I have broken the software in three parts. (i) Downloading jpgs and bmps, (ii) Downloading zip files (iii) Downloading HTML pages. I have successfully completed the first two parts, by receiving the header of the jpegs, and zips, but in HTML, the header turns out to be zero. The flaw in my code is that it downloads the entries which are resumeable, break them in eight sections and downloads section wise. I am very much confused how to proceed in HTML download. Kindly send me a quick small code, which can download HTML files. The code should be independant from any such ocx or dll which is not easily available or is shareware, coz I can not afford to spend money on this learning project. With this I offer you to send me emails if you want to get the source code of the rest of the download manager.

Wish you happy programming :)

A W Abid
0
Comment
Question by:awabid
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9922334
0
 
LVL 14

Accepted Solution

by:
aelatik earned 125 total points
ID: 9922341
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    If lngRetVal = 0 Then DownloadFile = True
End Function

Function MatchVersion()
    DownloadFile "http://www.yourdom.com/index.html", "c:\index.html"
End Function
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9922410
> With this I offer you to send me emails if you want to get the source code of the rest of the download manager.

I would like to look at the source for your download, what e-mail address should I sent the request to?

Dang123
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9922427
I modified Urldownloadtofile to manage file names dinamically. You could see it as part of

http://www.angelfire.com/realm/vb-shared/DownAllImg.htm

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9922437
By the way, that API let you download all files not only HTML ones.
Chees
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9922462
mozzarella?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9922510
uh?
0
 
LVL 1

Author Comment

by:awabid
ID: 9922524
My email address is awabid@hotmail.com please send me the mail with the subject DOWNLOAD MANAGER. Praying to God that u like the way ...lolz

Happy Programming :)
 
A W ABid
0
 
LVL 4

Expert Comment

by:RanaHossain
ID: 9930410
Awabid,

personally I would strongly suggest not to use URLDownloadToFile API if you want to create a professional download manager.

Reason : Proxy...

this API runs with your Internet Explorer settings. Now I have a system setup where Internet Explorer is set to check pages from my Internal Server (websites designed), and I use MYIE for browsing...

any program using URLDownloadToFile will fail, as the address will not be available on my local server...

where as something like GetRight will give me an option to use use whatever I want, may it be a proxy or no proxy.. WinSock is really the only way to do it.

http://www.vbip.com/winsock/winsock_http_01.asp
0
 
LVL 1

Author Comment

by:awabid
ID: 9955550
Hi Pals,
thank you so much for your kind support. I kept this question open for few days if anybody can pour in, and a couple of good ideas are there. To be true i am really confused, whom answer should be accepted and whom should be rejected. Nevertheless you can see the result.

Happy typing :)

A W Abid
0
 
LVL 1

Author Comment

by:awabid
ID: 9955560
By the way, i got the results from the accepted answer, but there were few more things which should be clarified. And it worked :) Everybody good job done!!!

Happy lunch :)

A W Abid
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question