Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Location
    Turkey
    Posts
    17

    HTTP.GetFileSize > convert to Mbyte format

    Hi. I used like these codes:

    Code:
    fSize = HTTP.GetFileSize("http://download.bleepingcomputer.com/sUBs/ComboFix.exe", MODE_BINARY, 20, 80, nil, nil, nil);
    Dialog.Message("Bla Bla", "File size is: "..fSize.." Mbyte", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1)
    This code gives file size: "3015597" but i want to give for Mbyte format( Like 2.9 MB). How can i do this?

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Hi,

    String.GetFormattedSize(number, FMTSIZE_AUTOMATIC) does what you want. Check the help file for details...

    Ulrich

  3. #3
    Join Date
    Jan 2009
    Location
    Turkey
    Posts
    17
    Thanks for your reply. I used your solution:

    Code:
    fSize = HTTP.GetFileSize("http://download.bleepingcomputer.com/sUBs/ComboFix.exe", MODE_BINARY, 20, 80, nil, nil, nil);
    mbSize = String.GetFormattedSize(fSize, FMTSIZE_AUTOMATIC) 
    Dialog.Message("Bla Bla", "File size is: "..mbSize.." Proceed to download?", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1)
    ...and it's worked!



    Thank you so much.

Posting Permissions

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