# [VB6] File size checking of many online files



## Shenk (Oct 10, 2008)

I'm trying to write a program that detects file sizes of online images..

So far I've tried to use FileLen to achive this and found out:
1.) It doesn't seem to be possible to get it to work with online files

2.) It doesn't seem to work if you set it to look at an imported image
(eg: Image1.Picture = LoadPicture("C:\Test.jpg")
Text1.Text = FileLen.Image1)

And i'd rather not download the files or use Winsocks unless i _REALLY _have to,
I am trying to run it to check over 10,000 images so downloading is not really a great option for me 

Any help?
[ I do know it'd be easier to write in other programs but i'm quite far into this one! and i don't know any other languages =( ]


----------



## draceplace (Jun 8, 2001)

I'm not sure this is possible, maybe some will tell us? Seems like you're wanting to see file system properties on systems you won't have access to. An html tag on a web page won't have the info your looking for.


----------



## Shenk (Oct 10, 2008)

But if I go into a site and Right-click on a picture it will have a properties menu that includes file size?...

UNLESS it's recieving that data from your temp files? Ooo! Maybe I can do it that way!

If anyone has a better way of doing this please do feel free to leave a message here, if not - i'll try and figure out how to do it using my Temp files


----------



## pvc_ (Feb 18, 2008)

I think temp files is the only way of doing this because your browser has already downloaded the pictures, that's how it calculates the size. Using LOF would probably be faster:

open "path" for input as #1
x=LOF(1)
close #1


----------



## nj2b (Sep 9, 2006)

What about wininet? MS has a VB 6 sample that you can modify to make head requests on the image uri. Here's is a class wrapper for wininet that is really easy to use for get and post requests, but I'm *sure* it would work with head requests too.

As I recall, the head request will give you the size of the resource without having to download it directly.

HTH


----------

