Sign in to follow this  
Followers 0
YpR^

Need a little help :)

29 posts in this topic

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 ? :ph34r:

It's something with this: $ANSWER1=FileOpenDialog( "Please choose a File", "c:\", "All (*.*)").... but it wont upload the file i specifi :(


Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

nope... didn't w0rk :ph34r:


Share this post


Link to post
Share on other sites

;** 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

Share this post


Link to post
Share on other sites

Nice copy ? :ph34r:


Share this post


Link to post
Share on other sites

Nice copy ? :(

<{POST_SNAPBACK}>

excuse me? :ph34r:

I corrected your script, because you said:

But dosen't work.... :/

Share this post


Link to post
Share on other sites

Hmmmm..... The one u posted is exactly like the one i posted myself =?

They doesn't work... LCD either CD


Share this post


Link to post
Share on other sites

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)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by SlimShady

Share this post


Link to post
Share on other sites

The problem is: Short :ph34r: - 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.


Share this post


Link to post
Share on other sites

The problem is: Short :ph34r: - 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) )

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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!


Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (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 by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

hmmm.... i used the

If $answer2 <> "" then

FileWriteline( $WriteFile, "cd " & $answer2 )

endif

But resulted in errors


Share this post


Link to post
Share on other sites

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 ? ,.... :">

Share this post


Link to post
Share on other sites

hmmm.... i used the

If $answer2 <> "" then

  FileWriteline( $WriteFile, "cd " & $answer2 )

endif

But resulted in errors

<{POST_SNAPBACK}>

what error ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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


Share this post


Link to post
Share on other sites

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

<{POST_SNAPBACK}>

You started with : FTP www.123.com

And got the prompt: User (www.123.com:(none)):

??


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0