Jump to content

How to download a file with out write "Temporary Internet Files"


 Share

Recommended Posts

"X:\Documents and Settings\username\Local Settings\Temporary Internet Files"

When download a file with "INETGET", Autoit will write the data to "Temporary Internet Files" too

then the "Temporary Internet Files" directory will overfolw

How to download a file with out write "Temporary Internet Files"?

THX!

Link to comment
Share on other sites

Function Reference

_INetGetSource

--------------------------------------------------------------------------------

Gets the source from an URL without writing a temp file.

#include <INet.au3>

_INetGetSource ( $s_URL )

That is from the help file. It basically allows you to save the source of url to a variable.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

#include <INet.au3>

$fr=_InetGetSource('http://221.214.21.70/ff5.00.exe')

FileWrite('c:\test.exe',$fr)

in run time ,the AutoIt3.exe use ram from 5300K com to 10200K

and when download end ,the "c:\test.exe" size is small then the 'http://221.214.21.22/ff5.00.exe'

this tell me: _InetGetSource can not use to download a file.

Link to comment
Share on other sites

Is there a specific reason you don't want to use a temporary file. It is standard for most programs to write a temporary file while they are downloading.

If you could tell us specifically why, maybe we could find an alternative solution to a temporary file.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

I am write a program ,it is used to update a lot of client computer from a web server,

I found when the client download file from server will to cause a lot of CPU useage,and if the file is too big will caused the TEMP disk overflow.

The temp disk is overflowing? You are speaking of a temporary directory. If a temporary directory "overflows" then that means that the hard disk is out of space. Sine a temp directory is nothing more than a special folder where temporary files are stored, if it runs out of space, that simply means that the hard drive itself is out of space. Therefore, to have it download a file, the best way would be to use InetGet().

I would also check to see how much hard disk space you have free before you attempt to download a file. If you are downloading large 1GB files, then the hard disk could be running out of space if you don't have enough free space for it.

I have written you a script that should help you in you download quest:

Download_Dialogue.au3

I have pretty much written the script there for you. ;)

There are two functions in there that you would easily copy into your own script. I hope that it is self explanatory. If you have further questions, feel free to post them.

The script above will download the file to the location specified. It will not use a temporary directory. It also has a nice little Download Progress GUI and gives the user the option to cancel the update if they wish. Upon canceling the update, the file that is being downloaded will be deleted and the program will close.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

study that:

TCPStartup()

$iPort = 80
$sHost = "www.autoitscript.com"
$sRequest = "GET / HTTP/1.0" & @CRLF & _
            "Host: " & $sHost & @CRLF & @CRLF;
$sIpAddr = TCPNameToIP($sHost)

$hSock = TCPConnect($sIpAddr,$iPort)
TCPSend($hSock,$sRequest)
While 1
    Sleep(250)
    $sBuff = TCPRecv($hSock,1024)
    If @error Then ExitLoop
    ConsoleWrite($sBuff)
WEnd

TCPCloseSocket($hSock)
TCPShutdown()
;)

and start learning http here:

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...