AzKay Posted July 22, 2006 Share Posted July 22, 2006 #include <GUIConstants.au3> #include <FTP.au3> Opt("GUIOnEventMode", 1) ### Koda GUI section start ### $News = GUICreate("News", 474, 254, 192, 118) $NewsBody = GUICtrlCreateEdit("", 0, 0, 473, 217, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) $Upload = GUICtrlCreateButton("Upload", 0, 224, 161, 25, 0) GUICtrlSetOnEvent(-1, "UploadClick") $UploadProgress = GUICtrlCreateProgress(168, 224, 297, 25) GUISetState(@SW_SHOW) ### Koda GUI section end ### $server = "php0h.com" $username = "user" $pass = "pass" $Dir = "/www/" While 1 Sleep(100) WEnd Func UploadClick() $ReadNews = GUICtrlRead($NewsBody) FileOpen("News.txt", 2) FileWrite("News.txt", $ReadNews) FileClose("News.txt") $Size = FileGetSize("News.txt") $Open = _FTPOpen("MyFTP Control") $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, $News, $Dir) $Ftpc = _FTPClose($Open) MsgBox(0, "", "Done") EndFunc It doesnt want to upload... And, how would I get the progress bar working here? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Developers Jos Posted July 22, 2006 Developers Share Posted July 22, 2006 (edited) It doesnt want to upload... And, how would I get the progress bar working here?Did you put checks for the @error code retuned by the FTP commands in your script so you know whats failing?Two issues in this line:$Ftpp = _FtpPutFile($Conn, $News, $Dir)$news = the Handle of a GUI control$dir doesn't contain a filename ...think thats needed ...EDIT: this is wrong too, leave it to you to sort out why:FileOpen("News.txt", 2)FileWrite("News.txt", $ReadNews)FileClose("News.txt") Edited July 22, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 Hmm, by the way, is there a help file for the ftp functions? I didnt seem to find it in the thread. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 I added in the @error after ftpputfile, changed the dir to /www/News.txt changed the file to "News.txt", Dont know what you mean with the File() functions. But it still isnt working. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
w0uter Posted July 22, 2006 Share Posted July 22, 2006 Read the helpfile on the file functions. Also no there is no 'helpfile' or documentation what so ever for the ftp functions (Ill put it on my big TODO list, right after "failing the schoolyear") It would help if you posted your new code and tell us the values @error has. 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...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 #include <GUIConstants.au3> #include <FTP.au3> Opt("GUIOnEventMode", 1) ### Koda GUI section start ### $News = GUICreate("News", 474, 254, 192, 118) $NewsBody = GUICtrlCreateEdit("", 0, 0, 473, 217, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) $Upload = GUICtrlCreateButton("Upload", 0, 224, 161, 25, 0) GUICtrlSetOnEvent(-1, "UploadClick") $UploadProgress = GUICtrlCreateProgress(168, 224, 297, 25) GUISetState(@SW_SHOW) ### Koda GUI section end ### $server = "php0h.com" $username = "user" $pass = "pass" While 1 Sleep(100) WEnd Func UploadClick() $ReadNews = GUICtrlRead($NewsBody) FileOpen("News.txt", 2) FileWrite("News.txt", $ReadNews) FileClose("News.txt") $Open = _FTPOpen("MyFTP Control") $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, "News.txt", "/www/News.txt") If @error Then MsgBox(0, "FtpPutFile", @error) $Ftpc = _FTPClose($Open) MsgBox(0, "", "Done") EndFunc It returns -1 # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
w0uter Posted July 22, 2006 Share Posted July 22, 2006 Whats the @error at the other commands ? Also try to make it @scriptdir & '\News.txt' 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...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 (edited) All the others were clean, no errors EDIT:: @scriptdir & "\News.txt" Didnt make any difference. Edited July 22, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
w0uter Posted July 22, 2006 Share Posted July 22, 2006 Try "www/News.txt" If that doesnt work im out of guesses. 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...
AzKay Posted July 23, 2006 Author Share Posted July 23, 2006 Doesnt seem to work either. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2006 Developers Share Posted July 23, 2006 did you check to content of news.txt ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AzKay Posted July 23, 2006 Author Share Posted July 23, 2006 check to content? to you mean, the? Yes I did, for some reason, now, its not writing the file, it was the 1st time I tryed... # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2006 Developers Share Posted July 23, 2006 (edited) check to content? to you mean, the? Yes I did, for some reason, now, its not writing the file, it was the 1st time I tryed...yes meant the.. Why do you think i mentioned the FileOpen/FileWrite/FileClose issue ? Try to read the helpfile and understand what it is telling you ! $H_file = FileOpen("News.txt", 2) FileWrite($H_file, $ReadNews) FileClose($H_file)oÝ÷ ÚÚºÚ"µÍ[Q[]J ][ÝÓ]ÜË ][ÝÊB[UÜ]J ][ÝÓ]ÜË ][ÝË ÌÍÔXY]ÜÊ Edited July 23, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AzKay Posted July 23, 2006 Author Share Posted July 23, 2006 (edited) Oke, now it writes, but doesnt upload still. Maybe its the ftp host thats dodgy? EDIT:: Isnt the host. Edited July 23, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # 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