x2norm Posted January 22, 2020 Posted January 22, 2020 This code does not work. It does not download the file. As i understand it, the file should be downloaded to the Public Download dir. it does not. I have confimred that the Url is correct. #include <InetConstants.au3> Local $sFilePath = "C:\Users\Public\Downloads\alteadccm.zip" InetGet("https://support.airline-choice.com\downloads\Altea\AlteaDCCM.zip", $sFilePath) Any ideas how to capture an error or something that would give me a clue as to why the file does not download? thanks,
Nine Posted January 22, 2020 Posted January 22, 2020 (edited) @error will tell. I was not able to DL it at first. I manually rewrote the URL and then it started working. Maybe a bad char inside the string, idk. Try this : #include <FileConstants.au3> #include <Constants.au3> #include <InetConstants.au3> #include <IE.au3> Local $sFilePath = "alteadccm.zip" Local $sUrl = "https://support.airline-choice.com/downloads/Altea/AlteaDCCM.zip" Local $iReturn = InetGet($sUrl, $sFilePath, $INET_FORCERELOAD+$INET_BINARYTRANSFER) MsgBox ($MB_SYSTEMMODAL,"",$iReturn & "/" & @error) ; also work with IE ;$oIE = _IECreate ($sUrl) ps. just noticed that your were using backslash in url... Edited January 22, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Musashi Posted January 22, 2020 Posted January 22, 2020 (edited) #include <InetConstants.au3> #include <WinAPIFiles.au3> #include <WinAPIShellEx.au3> Global $g_sURL = "https://support.airline-choice.com/downloads/Altea/" Global $g_sDownloadPath = _WinAPI_ShellGetKnownFolderPath($FOLDERID_Downloads) Global $g_sFilename = "AlteaDCCM.zip" ConsoleWrite("> Path for Downloads = " & $g_sDownloadPath & "\" & $g_sFilename & @CRLF) _Download() Func _Download() Local $hDownload = InetGet($g_sURL & $g_sFilename, $g_sDownloadPath & "\" & $g_sFilename, BitOR($INET_FORCERELOAD, $INET_BINARYTRANSFER), $INET_DOWNLOADBACKGROUND) ; Wait for the download to complete : Do Sleep(250) Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) ; total bytes received and filesize : ConsoleWrite("BytesSize InetGetInfo = " & InetGetInfo($hDownload, $INET_DOWNLOADREAD) & @CRLF) ConsoleWrite("BytesSize Local File = " & FileGetSize($g_sDownloadPath & "\" & $g_sFilename) & @CRLF) InetClose($hDownload) EndFunc ;==>_Download EDIT : Depending on your internet speed ==> The file is quite big, so please wait ! Edited January 22, 2020 by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now