Jump to content

Error allocating memory _FTP_ProgressDownload


ken82m
 Share

Recommended Posts

I've never used _FTP_ProgressDownload before (From the beta build.

I got this sort of working but when the download starts I get an error.

As soon as "_FTP_ProgressDownload" executes I get "Error allocating memory."

Any help would be appreciated.

Thanks,

Kenny

#include <FTPEx.au3>

;Connect to FTP server
$FTPIdentifier = _FTP_Open("ftpupdate")
$FTPSession    = _FTP_Connect($FTPIdentifier, "ftp.antivirus.com", "", "")

FileDelete("ssapiptn.zip")

_FTP_DirSetCurrent($FTPSession, "products/pattern/spyware/ssapi/")
$1 = _FTP_ProgressDownload($FTPSession, "ssapiptn.zip", "ssapiptn.zip")
MsgBox(0,$1, @error)

;Disconnect FTP session
_FTP_Close($FTPIdentifier)
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

For what it's worth I tracked the error down to line 961 in the UDF.

$buffer = DllStructCreate("byte[" & $x & "]")

But how to fix it I have no idea

Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Hmm, i can't find an error. Maybe you try to donwload a big file and the UDF can't allocate enough memory to donwload one part. Could you tell me the size of the file, please :D

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Hmm, i can't find an error. Maybe you try to donwload a big file and the UDF can't allocate enough memory to donwload one part. Could you tell me the size of the file, please :D

Hi,

it's about 6 MB.

I think he must have another problems.........

;-))

Stefan

Edited by 99ojo
Link to comment
Share on other sites

Oh, you found a bug wich was added in the standard-include in the beta :D My original funtion worked...

Found it: Change the order if the params in line 947 :D

$glen = _WinAPI_MakeQWord($ai_FTPGetFileSize[2], $ai_FTPGetFileSize[0]) ;FileGetSize($s_RemoteFile)
; to
$glen = _WinAPI_MakeQWord($ai_FTPGetFileSize[0], $ai_FTPGetFileSize[2])

//Edit: added bugreport: #1167

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Works perfect now.

Thanks alot this is a great function :D

-Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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...