YoseMite Posted June 15, 2005 Share Posted June 15, 2005 Hey,I want upload a JPEG picture to my webserver.But the FTP script of Wouter doesn't work... I've got a error on line 73:Return $ai_FTPPut[File[0]Reurn $ai_FTPPutFile^ERRORError: Subscript used with non-Array variable.Line 73: Return $ai_FTPPutFile[0]The rest of my code:#include <FTP.au3> $server = 'ftp.account.be' $username = 'webmaster#account.be' $pass = 'mypass' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, 'C:\image.jpg', '/www/image.jpg') $Ftpc = _FTPClose($Open)FTP.au3 Link to comment Share on other sites More sharing options...
/dev/null Posted June 15, 2005 Share Posted June 15, 2005 Return $ai_FTPPut[File[0]Reurn $ai_FTPPutFile^ERRORError: Subscript used with non-Array variable.I have'nt used wouters script yet, so I don't really know. But, according to the help file:If the function call fails then @error is set to 1. Otherwise an array is returned that contains the function return value and a copy of all the parameters (including parameters that the function may have modified).So I guess, the function call failes for some reason (maybe wrong FTP-or File-path or missing write permissions), so the return value of DllCall is NOT an array. Accessing that non-existant array will cause the script to fail. I guess, wouter has to add some error checking to his UDFs.@wouter - just an idea: After a failure of DLLCall, do a second DllCall to GetLastError to get further info about the problem that caused FtpPutFile to fail. See MSDN - FtpPutFile@YoseMite: At the moment there is nothing you can do, except adding the error checking in wouters code yourself, or check why the upload fails. Try to upload your file and check if that works.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
w0uter Posted June 15, 2005 Share Posted June 15, 2005 (edited) what numbers get assignt to:$Open$Conn$Ftpp$Ftpclike i sayd beforethis is the (unfinished) result.#cscheck'd out GetLastError and it returned no usefull info according to me.still i altered the err handeling a bit. i will upload it into the original thread.#ce Edited June 15, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
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