1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

[VB6] File size checking of many online files

Discussion in 'Software Development' started by Shenk, Oct 9, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. Shenk

    Shenk Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    2
    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 =( ]
     
  2. draceplace

    draceplace

    Joined:
    Jun 8, 2001
    Messages:
    2,583
    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.
     
  3. Shenk

    Shenk Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    2
    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 ;)
     
  4. pvc_

    pvc_

    Joined:
    Feb 17, 2008
    Messages:
    490
    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
     
  5. nj2b

    nj2b

    Joined:
    Sep 9, 2006
    Messages:
    60
    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
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757721

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice