Sign in to follow this  
Followers 0
snoozer

problem with upload(ftp.au3)

2 posts in this topic

firstable i want to say i browsed this forum for this topic but didn't found anything matching to my problem i'm sorry for annoying some people ;)

here is my problem i want to upload a file(in the same dictionary like my script) and upload it to a server in the dictonary "/upload_dir/". When you look in the script you'll see(or not :whistle: ) that i want to change the name of the file in this way: "sometext"+"_"+"current time". The messagebox is therefor to check whether this script works or not.

Here the script

#include<ftp.au3>
$server = "151.189.20.30";can take ip or hostname: home.arcor.de(german host)
$username = "mynick";i know this
$pass = "mypass"; and this either  :lol: 

$passive = 1; 0 = active, 1 = passive (just found in this forum  :graduated: )
$dir = "/upload_dir/";dictionary where the file have to be uploaded
$time = @HOUR&":"&@MIN&":"&@SEC ; current (local) time

$additional_text = "hello_world";additional text changes when user change(=variable)

$Open = _FTPOpen("MyFTP Control")
$Conn = _FTPConnect($Open, $server, $username, $pass,$passive)
$Ftpp = _FtpPutFile($Conn,@ScriptDir&"\file.txt",$dir&$additional_text&"_"&$time&".txt")
MsgBox(0,"",$Conn&" "&$Ftpp);return 0 0 => failure
$Ftpc = _FTPClose($Open)

;to change dictonary in this way _FtpSetCurrentDir($Conn, "/upload_dir/") doesn't work either cause a problem occours when i want to connect to "my" server

i hope somebody can help me :P

thx a lot

/snoozer


ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°$₪Ǿَ€Яº¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø

Share this post


Link to post
Share on other sites



firstable i want to say i browsed this forum for this topic but didn't found anything matching to my problem i'm sorry for annoying some people ;)

here is my problem i want to upload a file(in the same dictionary like my script) and upload it to a server in the dictonary "/upload_dir/". When you look in the script you'll see(or not :whistle: ) that i want to change the name of the file in this way: "sometext"+"_"+"current time". The messagebox is therefor to check whether this script works or not.

Here the script

#include<ftp.au3>
$server = "151.189.20.30";can take ip or hostname: home.arcor.de(german host)
$username = "mynick";i know this
$pass = "mypass"; and this either  :lol: 

$passive = 1; 0 = active, 1 = passive (just found in this forum  :graduated: )
$dir = "/upload_dir/";dictionary where the file have to be uploaded
$time = @HOUR&":"&@MIN&":"&@SEC ; current (local) time

$additional_text = "hello_world";additional text changes when user change(=variable)

$Open = _FTPOpen("MyFTP Control")
$Conn = _FTPConnect($Open, $server, $username, $pass,$passive)
$Ftpp = _FtpPutFile($Conn,@ScriptDir&"\file.txt",$dir&$additional_text&"_"&$time&".txt")
MsgBox(0,"",$Conn&" "&$Ftpp);return 0 0 => failure
$Ftpc = _FTPClose($Open)

;to change dictonary in this way _FtpSetCurrentDir($Conn, "/upload_dir/") doesn't work either cause a problem occours when i want to connect to "my" server

i hope somebody can help me :P

thx a lot

/snoozer

Everything there looks just about right to me, except for one glaring problem.

Based on your script above, you're trying to send @ScriptDir\file.txt to your ftp site as this file:

/upload_dir/helloworld_10:30:00.txt

The ":" is invalid - try removing those so that you're uploading the file as /upload_dir/helloworld_103000.txt

If you are having problems even getting to that directory, trying checking the error status of each FTP command after you do it - that will help you isolate the problem area and the command you need to focus on. I use these FTP scripts as well and do not have a problem.

(Also, I do not use the 'passive' flag like you are using, I don't know what problems that may or may not produce.)

One last thing - not sure if you're using "MyFTP Control" as the session name - i don't know if that's a problem or not, but trying change it to a single word, ie, "$Open = _FTPOpen("myftp") "

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