HTTP.Download function - Updated...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Intrigued
    Indigo Rose Customer
    • Dec 2003
    • 6125

    HTTP.Download function - Updated...

    I think this was removed (post) before because I was trying to help by linking to a executable (.exe) on my Website. I understand, that bot thing again I recon.

    Here is the updated function with a dummied URL in the function call.

    Code:
    [COLOR=DarkGreen]--[[
    Here is a function that gets and returns (in a Dialog.Message()) the file size.
    Make sure you use double quotes ("") when typing in the strFile argument!
    ]][/COLOR]
    function fnGetFileSize(strFile)
    	nFileSize = HTTP.GetFileSize(strFile, MODE_BINARY, 5, 80, nil, nil, nil)
    		err = Application.GetLastError()
    			if err ~= 0 then
    				Dialog.Message("Error during download!", _tblErrorMessages[err])
    					Application.ExitScript()
    			else
    				nFileSize = String.GetFormattedSize(nFileSize, FMTSIZE_AUTOMATIC, true)
    					Dialog.Message("The file's size is...", nFileSize)
    			end
    end
    
    [COLOR=DarkGreen]-- Then call (use) the function, like this example. (change the argument to the file path needed! - the argument is what's between the parenthesis '()')[/COLOR]
    fnGetFileSize("[B]http://www.yourwebsitehere.com/afile[/B]")
    Intrigued
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9741

    #2
    Hi. Your post wasn't removed, it was just moved to the AMS examples forum... :yes

    Comment

    • Intrigued
      Indigo Rose Customer
      • Dec 2003
      • 6125

      #3
      Oh! Can you remove this one then Corey, I must have missed that, sorry!

      Intrigued

      Comment

      Working...
      X