BetaArchive Logo
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 53d, 16h, 3m | CPU: 37% | MEM: 5714MB of 12227MB used
{The community for beta collectors}

Forum rules


Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPost subject: VB6 problems :(        Posted: Mon May 11, 2009 4:35 pm 
Reply with quote
i'm trying to create an updater for kryce online, ddoupt youve heard of it but anyway :P its all going well apart from one thing, i need to know how to read a file size from a url without downloading the file. so it checks the file size so i can show its updating progress, if you get what i mean? any ideas?

i already tried filelen(filepath) that doesnt work for URL's though


Top
 PostPost subject: Re: VB6 problems :(        Posted: Tue May 12, 2009 3:52 am 
Reply with quote
Donator
Offline

Joined
Tue Oct 17, 2006 8:26 pm

Posts
930
Microsoft Winsock Control (mswinsck.ocx)

Catch DataArrival


Top  Profile
 PostPost subject: Re: VB6 problems :(        Posted: Wed May 13, 2009 1:40 pm 
Reply with quote
Donator
Offline

Joined
Fri Aug 18, 2006 12:05 pm

Posts
698

Location
Or-stray-liagh
If you want to get the size of a file on a web server without getting the whole thing, the best thing to do would be to use a HTTP HEAD command. You'd use Winsock to create a connection to the webserver on port 80, and send it "HEAD /path/to/file.ext HTTP/1.0" without the quotes, and a carriage return. Then it will send you back a set of headers. Read each string until you find one which starts with "Content-length:" and then parse that to get the length in bytes. Then close the socket and you're done.

On an unrelated note, you really shouldn't be using VB6 as it's such an old, antiquated language which teaches bad programming practices. :P </cs-student>

_________________
pr0gram the pr0grammer
BetaArchive retiree | OSBA Expat


Top  Profile
 PostPost subject: Re: VB6 problems :(        Posted: Wed May 13, 2009 2:10 pm 
Reply with quote
Donator
Offline

Joined
Tue Oct 17, 2006 8:26 pm

Posts
930
Content-length isn't guaranteed to exist, however, using it if it does is likely the better option.

I also agree... unless you have experience programming with something else and are knee deep in VB6 code, I'd pick a different language.


Top  Profile
 PostPost subject: Re: VB6 problems :(        Posted: Wed May 13, 2009 3:49 pm 
Reply with quote
i know but its also easy :P

and its the only one i know XD and i figured it out now kinda, someone i know found a module for http file info so :P thanks anyway guys :)


Top
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 




Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2018

 

Sitemap | XML | RSS