Advanced Search

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: help with file size with php

  1. #11
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    586
    Thanks
    41
    Thanked 27 Times in 27 Posts

    Default

    I don't know how many times or ways I can say it.

    The script returns all file sizes in bytes-regardless as t hoe big it is.

    I was merely hoping to get the script to change and give results in kb,mb,gb,tb if the size was this big

    As it is it reports sizes in bytes only

    ie; 397bytes,4,932bytes 34,987bytes or even 234,875bytes and so on in stead of 3.2kb or 1.4mb and so on.

    I will keep tinkering with the original until I either get it or decide to dump the idea.

    I just thought that if I posted the original script and the second one(this uses the bytes,kb,mb,gb,tb in the script) that it would be an easy fix for a php guru.

    But thanks for looking
    Thanks,

    Bud

  2. #12
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    586
    Thanks
    41
    Thanked 27 Times in 27 Posts

    Default

    As to my request at http://css-tricks.com a new file was made and it includes the re-work for file sizes like I was looking for.
    with that and my addition of the image atributes for width and height I am a happy camper now.

    here is my working file
    http://www.web-user.info/directory/.index.php

    I will submit this as resolved
    Thanks,

    Bud

  3. #13
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,632
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by ajfmrf View Post
    I don't know how many times or ways I can say it.

    The script returns all file sizes in bytes-regardless as t hoe big it is.

    I was merely hoping to get the script to change and give results in kb,mb,gb,tb if the size was this big

    As it is it reports sizes in bytes only

    ie; 397bytes,4,932bytes 34,987bytes or even 234,875bytes and so on in stead of 3.2kb or 1.4mb and so on.
    I understand this. The thing I was trying to understand is why you are getting "bytes only" results.
    This is confusing to me, because I tested the function several times, and the result was not displayed in "bytes only"; it correctly used "KB" or "MB", etc..

    When you say the script "returns errors", do you mean that there are actual error messages (i.e., PHP errors)? or just that it gave you a result you did not want? Perhaps that was part of our confusion.

    Quote Originally Posted by ajfmrf View Post
    I just thought that if I posted the original script and the second one(this uses the bytes,kb,mb,gb,tb in the script) that it would be an easy fix for a php guru.

    But thanks for looking
    You are welcome. I understand that you have resolved this problem, but, if you are willing, could you post the code that is working as you desired? I'd be interested in understanding what the difference might be.

  4. #14
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    586
    Thanks
    41
    Thanked 27 Times in 27 Posts

    Default

    Hi Adrian these are the files(text files) of the original script

    http://www.web-user.info/directory/.aindex.txt

    And here is the new version

    http://www.web-user.info/directory/.index.txt

    I was able to add the attributes part to it and get it to show the width and height of images-there probally is a better way to do it then what I came up withThis is my first success getting php code to work on my own

    Maybe a new way to change it so just the numbers without the "width" and the "height" would be an upgrade to what I got to work but being a newbie I am happy with the way it is , lol

    Notice the second file is larger and includes to code to list file sizes like we were looking at with the new code I found.

    The code is located here:

    http://css-tricks.com/snippets/php/d...tory-contents/

    What is embeded at the top of the page is the old script-go way down to the end of that code and get the zip file which has the updated files

    any questions? it is a neat script I think.
    Thanks,

    Bud

Similar Threads

  1. Looking for auto file size lister to go in html
    By SpaceNeedler in forum Looking for such a script or service
    Replies: 2
    Last Post: 11-29-2010, 05:11 PM
  2. Size of file on domain
    By bluewalrus in forum PHP
    Replies: 3
    Last Post: 10-24-2009, 06:45 PM
  3. Replies: 11
    Last Post: 08-09-2008, 08:18 AM
  4. File size problem - Directory size problem
    By davepatmanning@yahoo.com in forum The lounge
    Replies: 1
    Last Post: 05-09-2007, 07:17 PM
  5. Jim's DHTML Meny V5.7 File Size Problem
    By demtro in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 09-27-2005, 03:16 AM

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
  •