Jump to content

Can someone help me with that FTP ?


Recommended Posts

#include <FTP51.au3>

$server = 'server'
$username = 'username'
$pass = 'mypass'
$passive = 1

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass, $passive)
$Ftpp = _FtpPutFile($Conn, @MyDocumentsDir & '\Full3.jpg', 'Full3.jpg')
$Ftpc = _FTPClose($Open)

This code is good and works fine but..

.. i wanna make a multiple images upload for example:

Full.jpg

Full1.jpg

Full2.jpg

Full3.jpg

Full4.jpg

and more

i tried to make something like that :

#include <FTP51.au3>

$server = 'server'
$username = 'username'
$pass = 'pass'
$passive = 1
$pwnt1 = "'\"
$pwnt2 = "'"
$Full = "Full"
$num = 3
$roz = ".jpg"


$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass, $passive)
$Ftpp = _FtpPutFile($Conn, @MyDocumentsDir & $pwnt1 & $Full & $num & $roz & $pwnt2, $pwnt2 & $Full & $num & $roz & $pwnt2)
$Ftpc = _FTPClose($Open)

and this is not working.. maybe someone has an idea how to fix it ?

#include <FTP51.au3>

$server = 'server'
$username = 'username'
$pass = 'pass'
$passive = 1
$pwnt1 = "'\"
$pwnt2 = "'"
$Full = "Full"
$num = 6
$roz = ".jpg"


$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass, $passive)
$Ftpp = _FtpPutFile($Conn, @MyDocumentsDir & '\Full' & $num & '.jpg', 'Full' & $num & '.jpg')
$Ftpc = _FTPClose($Open)

ok i got this :D t/c

it was easy but i lost in this " , ' , '\ and others :D

Edited by cagiva
Link to comment
Share on other sites

I'm not familiar with FTP51.au3, but I take it it's similar to what I use.

I think your problem is this: "MyDocumentsDir & $pwnt1" as $pwnt1 plases a " ' " in the middle of your dir path.

Try $pwnt1 = "\" instead.

Edit: damn too slow. :<

Edited by Tvern
Link to comment
Share on other sites

I'm not familiar with FTP51.au3, but I take it it's similar to what I use.

I think your problem is this: "MyDocumentsDir & $pwnt1" as $pwnt1 plases a " ' " in the middle of your dir path.

Try $pwnt1 = "\" instead.

Edit: damn too slow. :<

FTP51 its renamed FTP.au3 from this forum.

Thanks for your help btw. every % of help is good.

Its my new code :D

#include <FTP51.au3>

$server = 'server'
$username = 'username'
$pass = 'pass'
$passive = 1

$num = 1
$roz = ".jpg"

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass, $passive)
    $Ftpp = _FtpPutFile($Conn, @MyDocumentsDir & '\Full' & '.jpg', @YEAR & "-" & @MON & "-" & @MDAY & "-" & @HOUR & "-" & @MIN & "-" & @SEC & '.jpg')
For $num = 1 to 9 Step +1
    $Ftpp = _FtpPutFile($Conn, @MyDocumentsDir & '\Full' & $num & '.jpg',  @YEAR & "-" & @MON & "-" & @MDAY & "-" & @HOUR & "-" & @MIN & "-" & @SEC & '.jpg')
Next
MsgBox(1,"FTP","Everything uploaded :)")
$Ftpc = _FTPClose($Open)
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...