How to find the file size of a remote link

Discussion in 'PHP' started by irfan saleem, May 31, 2009.

  1. #1
    Hi,

    I want to know how to find the file size of a remote link....I mean to say when we add the link it automatically show its exact size.

    Thanks
     
    irfan saleem, May 31, 2009 IP
  2. ShadyStudent

    ShadyStudent Peon

    Messages:
    341
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Need more info.

    If you are talking about getting the file size of a remote file that is on a different server then you can not unless that server is yours.

    However, you can attempt to download it and analyse the headers sent, it may contain the file size attribute which you can check for. If not, final option is to download file fully to your server and then check the file size.
     
    ShadyStudent, May 31, 2009 IP
  3. Sudoku-Master

    Sudoku-Master Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    for the size of a linked website you need the size of all other elements too... images, movies, extern javascript and so on...
     
    Sudoku-Master, May 31, 2009 IP
  4. irfan saleem

    irfan saleem Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    66
    #4
    check it yourself here....this script is working here...

    http://rapidshare.itmehal.com/olc/audl.php

    Paste any rapidshare or Megaupload link, press download and it will tell you its size in Status column.

    Just use these links as an example....

    http://rapidshare.com/files/220836924/recovery.record.part01.rar
    http://www.megaupload.com/?d=0TXZGIY6
    Code (markup):
     
    irfan saleem, May 31, 2009 IP
  5. ShadyStudent

    ShadyStudent Peon

    Messages:
    341
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your link requires a username and password.

    I said it was possible if the file was on YOUR server so rapidshare, megaupload and any other hosting service can do this.

    Why don't you explain what you want exactly a bit more clearly. Are the files you want to check the size of on your own server or elsewhere?
     
    ShadyStudent, May 31, 2009 IP
  6. irfan saleem

    irfan saleem Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    66
    #6
    Ohh sorry i forgot to give the username and password.....

    Yeah i know that it is very easy to find the size of the file if it is on our own server.

    Actually i have a linkchecker script and i want that when user check the links there...It also show the size of each file they check....The files are not on my server...these are remote files...on other servers like rapidshare, megaupload.etc....

    If u want the the login information, here it is:

    UserName : Faizan
    Password : superduper
     
    irfan saleem, May 31, 2009 IP