Jump to content

Need a little help :)


YpR^
 Share

Recommended Posts

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 :(

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

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.

Link to comment
Share on other sites

  • Developers

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

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

  • Developers

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

  • Developers

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

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

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

  • Developers

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

  • Developers

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

  • Developers

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)):

??

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...