Results 1 to 15 of 15

Thread: Getting the size of a file

  1. #1
    ChimpFace9000
    Guest

    Post

    Hey, how about next to the link of an attached file, how about the size of the file? Something like...

    PHP Code:
    <?
        $Size = filesize(File_Name);
        $Type = "bytes";
        if($Size > 1024)
            {$Size = $Size / 1024; $Type = "kb";}
        if($Size > 1024)
            {$Size = $Size / 1024; $Type = "mb";}
        $Size = round($Size, 1);
        print "$Size $Type";
    ?>
    I know you could have figured it out your self, but i thought if i did it, you would be more inclined to add it to the page.

  2. #2
    New Member
    Join Date
    Jan 2001
    Posts
    3
    the files are actually stored in the mysql database so it might be a bit harder than that.

  3. #3
    Guest
    Are you of the people working on V-Bulletin, and if so, is that a no?

  4. #4
    New Member
    Join Date
    Jan 2001
    Posts
    3
    i am not, the people who are are freedie, ed, jimf, stallion and and john.

    i was just saying it would be harder to do than suggested not that either it won't be done or that it can't be done.

  5. #5
    Guest
    the files are not stored in the mysql database..... I am 99% sure of it....

    don't think you can put stuff like that into MySQL....

  6. #6
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    593
    Well you're 99% wrong then

    They are stored in the database.

    John

  7. #7
    Guest
    Ok, that was unexpected..... how do you do it?

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    BLOB fields I expect
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Guest
    BLOB fields?

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Binary Large OBject.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    Guest
    Ahhhh, so how do I use these so called "blob fields"?

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Er...John....do you.......erm....uh.....know at all???

    *runs away and hides in corner*
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  13. #13
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    593
    Just like you would any other text field - you can just put lots of data into it.

    John

  14. #14
    Guest
    So it's.......


    CREATE TABLE ......... pagetext MEDIUMTEXT, exething BLOB.......


    and how do you insert the data, do you open the file and retreive the contents, then put it in???



    I found a little bit of info on mysql.com but it doesn't really say how to use it:

    http://www.mysql.com/doc/B/L/BLOB.html

  15. #15
    Addicted Member Active's Avatar
    Join Date
    Jan 2001
    Location
    Lat: 13° 4' 46" N, Long: 80° 15' 20" E
    Posts
    209
    If you can't beat your computer at chess, try kickboxing !!!
    [Download Tag Editing Tools.]

Posting Permissions

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



Click Here to Expand Forum to Full Width