Alexxander Posted May 21, 2014 Posted May 21, 2014 (edited) hi all i have thisĀ #include <FTPEx.au3> Local $sServer = 'ftp.mysite.com' Local $sUsername = 'myusername' Local $sPass = 'mypass' Local $hOpen = _FTP_Open('MyFTP Control') Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass) while 1 $file = InputBox("", "") $open = FileOpen("file",2) FileWrite("file",$file) FileClose($open) _FTP_FilePut($hConn,"file","/htdocs/file.html") WEnd Local $Ftpc = _FTP_Close($hConn) Local $Ftpo = _FTP_Close($hOpen) this cod must login to my site and upload a file called "file" with content of what the user enters in the inputbox the problem is if i keep typing content in the input box after each others it will work fine but when i be late for about 30 seconds or more it will not upload anything 1-my question is: does ftp have a timeout or something like that ? 2-is what im doing right i must not include the ftp open and close in the while loop ? 3-can i edit a file without re-uploading it ? Edited May 21, 2014 by Alexxander
Geir1983 Posted May 22, 2014 Posted May 22, 2014 (edited) Why dont you just connect to ftp after you have written your file? Edit: and why do you loop this script? You never exit the loop? Edited May 22, 2014 by Geir1983 Alexxander 1
Alexxander Posted May 22, 2014 Author Posted May 22, 2014 Why dont you just connect to ftp after you have written your file? Edit: and why do you loop this script? You never exit the loop? bro my problem is not exiting the loop and i dont mind if it took more time to write the file my problem is that the connection disconnects when in active
Geir1983 Posted May 22, 2014 Posted May 22, 2014 You are not active on the ftp connection when you are waiting for the user input, why connect to the ftp before the file is ready to upload? And whats with the attitude? When you never exit your loop you never call the _FTPClose functions in your script..
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