YpR^ Posted September 3, 2004 Share Posted September 3, 2004 Well... i've this code (made by ppl of the forum) ;** Get Filename and Directory $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)") $answer2 = InputBox("Mappe","Mappe navn - lad den stå tom, hvis home fodleren skal bruegs : ","h4x") StringLower($Answer1) ;** Bomb out on nul input if @error <> 0 or $answer1="" then msgbox(0,"Message","Erhm... h4x") exit endif ;** Create ftp parameters file FileOpen ( "ftp.ftp", 2 ) FileWriteline( "ftp.ftp", "1234" ) FileWriteline( "ftp.ftp", "24321" ) FileWriteline( "ftp.ftp", "cd " & $answer2 ) FileWriteline( "ftp.ftp", "binary" ) FileWriteline( "ftp.ftp", "send " & $answer1 ) FileWriteline( "ftp.ftp", "quit" ) fileclose("ftp.ftp") ;** Run ftp program RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp www.123.com', "", @SW_HIDE) Func NoWait() $continue = 16 EndFunc But dosen't work.... :/ What's wrong ? It's something with this: $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)").... but it wont upload the file i specifi Link to comment Share on other sites More sharing options...
32767 Posted September 5, 2004 Share Posted September 5, 2004 FileWriteline( "ftp.ftp", "cd " & $answer2 )Shouldn't you be doing a lcd instead of a cd? Also, when I tried (by hand on win98), lcd didn't work if there was a space, so you may need to quote it. FileWriteline( "ftp.ftp", 'lcd "' & $answer2 & '"' ) I haven't tested this myself, so let me know if it doesn't work. 00110100010001110110111101100100 Link to comment Share on other sites More sharing options...
YpR^ Posted September 10, 2004 Author Share Posted September 10, 2004 nope... didn't w0rk Link to comment Share on other sites More sharing options...
SlimShady Posted September 10, 2004 Share Posted September 10, 2004 ;** Get Filename and Directory $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)") $answer2 = InputBox("Mappe","Mappe navn - lad den stå tom, hvis home fodleren skal bruegs : ","h4x") StringLower($Answer1) ;** Bomb out on nul input if @error <> 0 or $answer1="" then msgbox(0,"Message","Erhm... h4x") exit endif ;** Create ftp parameters file $WriteFile = FileOpen ( "ftp.ftp", 2 ) FileWriteline( $WriteFile, "1234" ) FileWriteline( $WriteFile, "24321" ) FileWriteline( $WriteFile, "cd " & $answer2 ) FileWriteline( $WriteFile, "binary" ) FileWriteline( $WriteFile, "send " & $answer1 ) FileWriteline( $WriteFile, "quit" ) fileclose($WriteFile) ;** Run ftp program RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp www.123.com', "", @SW_HIDE) Func NoWait() $continue = 16 EndFunc Link to comment Share on other sites More sharing options...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 Nice copy ? Link to comment Share on other sites More sharing options...
SlimShady Posted September 12, 2004 Share Posted September 12, 2004 Nice copy ? <{POST_SNAPBACK}>excuse me? I corrected your script, because you said: But dosen't work.... :/ Link to comment Share on other sites More sharing options...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 Hmmmm..... The one u posted is exactly like the one i posted myself =? They doesn't work... LCD either CD Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 Hmmmm..... The one u posted is exactly like the one i posted myself =? They doesn't work... LCD either CD <{POST_SNAPBACK}>YpR^, what is the problem you have with the script ? You could change the commandline to generate a logfile to see what is wrong in the FTP session: RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp www.123.com >ftp.log', "", @SW_HIDE) 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...
SlimShady Posted September 12, 2004 Share Posted September 12, 2004 (edited) I have a feeling that you have to use double quotes in the CD line. Change this: FileWriteline( $WriteFile, "cd " & $answer2 ) To this: FileWriteline( $WriteFile, 'cd "' & $answer2 & '"') Edited September 12, 2004 by SlimShady Link to comment Share on other sites More sharing options...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 The problem is: Short - The script doen't upload the file i specifi in the "choose file box". Before i added the $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)") it worked perfectly. BUT i had to place the file i wanted to upload in the same folder, and had to write the full name of it in a dialog box. I'll try ur examples JdeB and SlimShady. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 The problem is: Short - The script doen't upload the file i specifi in the "choose file box". Before i added the $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)") it worked perfectly. BUT i had to place the file i wanted to upload in the same folder, and had to write the full name of it in a dialog box. I'll try ur examples JdeB and SlimShady. <{POST_SNAPBACK}>You could also try convert the filename to its shortname like: FileWriteline( $WriteFile, "cd " & FileGetShortName($answer2) ) 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...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 I get this log: 230 User logged in, proceed. ftp> ftp> Folder on computer cd binary 550 /binary: No such file or directory. ftp> ftp> send C:\Documents and Settings\YpR^\h4x.exe quit 221 Goodbye! Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 I get this log: 230 User logged in, proceed. ftp> ftp> Folder on computer cd binary 550 /binary: No such file or directory. ftp> ftp> send C:\Documents and Settings\YpR^\h4x.exe quit 221 Goodbye! <{POST_SNAPBACK}>You could check if the validity of all commands by starting FTP manually and doing the commands from the FTP.FTP file yourself. The FTP command HELP will show all valid commands... 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...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 (edited) Just tested a bit more with your script and one thing you have to make sure is that the $answer2 is not empy because that will create this error..... If it should be possible then test like this: If $answer2 <> "" then FileWriteline( $WriteFile, "cd " & $answer2 ) endif Edited September 12, 2004 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...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 hmmm.... i used the If $answer2 <> "" then FileWriteline( $WriteFile, "cd " & $answer2 ) endif But resulted in errors Link to comment Share on other sites More sharing options...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 You could check if the validity of all commands by starting FTP manually and doing the commands from the FTP.FTP file yourself. The FTP command HELP will show all valid commands... <{POST_SNAPBACK}>How do u manually do those commands ? ,.... :"> Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 hmmm.... i used the If $answer2 <> "" then FileWriteline( $WriteFile, "cd " & $answer2 ) endif But resulted in errors <{POST_SNAPBACK}>what error ? 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...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 How do u manually do those commands ? ,.... :"> <{POST_SNAPBACK}>Open the file FTP.FTP in your editor... Open cmd or Command.com type FTP Enter Do all commands as listed.. See wher it goes wrong... 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...
YpR^ Posted September 12, 2004 Author Share Posted September 12, 2004 Open FTP.FTP in f-example Scite ?... well.. the things listed there is user pass directory binary ? send "file" quit those to write in cmd ? i tried but none seemed to work ... Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2004 Developers Share Posted September 12, 2004 Open FTP.FTP in f-example Scite ?... well.. the things listed there is user pass directory binary ? send "file" quit those to write in cmd ? i tried but none seemed to work ... <{POST_SNAPBACK}>You started with : FTP www.123.com And got the prompt: User (www.123.com:(none)): ?? 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...
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