SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast Scripting X's Avatar
    Join Date
    May 2001
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving the file size of a given file

    Hi sitepoint,

    I have a question about (.zip, .tar, .tar.gz) files. I want to know how you can get the file size of the given file, although I do use mysql to store certain information about the script, NO ACTUAL file is stored in the db, instead that is in a dir. so obviously strlen() would be pointless. I just wanted to know what methods I could use for checking out the file size of the given file.

    Thanks, Chris.
    cgi://www.scriptingx.com - Everything CGI

  2. #2
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep. Named, appropriately enough, filesize()
    Kevin

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your uploading it via yoru web browser - ie upload script - you could use $uploadedfile_size where $uploadedfile is the name attribute of the file input type in your form. php automatically creates and stores the files size in bytes in that variable.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •