Sign in to follow this  
Followers 0
AngelTouch

(Q) upload from txt ?

6 posts in this topic

#1 ·  Posted (edited)

hello every one i'm new at autoit but i did lot of good things that amazed me

i didn't think that i'll be at this lvl

i did a script that search my HDD for full link and put all in txt

now i want to upload them .

my file is saved in D:\items.txt

now the hard part that i'm have trouble with

upload line 1 then check size

upload line 2 then check zize

till it's done

D:\downloading\da bible\The Divine Book (pt.1).mp4

D:\downloading\da bible\The Divine Book (pt.1).srt

D:\downloading\da bible\The Divine Book (pt.10).mp4

D:\downloading\da bible\The Divine Book (pt.10).srt

D:\downloading\da bible\The Divine Book (pt.2).mp4

D:\downloading\da bible\The Divine Book (pt.2).srt

E:\downloading\da bible\The Divine Book (pt.3).mp4

E:\downloading\da bible\The Divine Book (pt.3).srt

E:\downloading\da bible\The Divine Book (pt.4).mp4

E:\downloading\da bible\The Divine Book (pt.4).srt

F:\downloading\da bible\The Divine Book (pt.5).mp4

F:\downloading\da bible\The Divine Book (pt.5).srt

J:\downloading\da bible\The Divine Book (pt.6).mp4

J:\downloading\da bible\The Divine Book (pt.6).srt

J:\downloading\da bible\The Divine Book (pt.7).mp4

J:\downloading\da bible\The Divine Book (pt.7).srt

M:\downloading\da bible\The Divine Book (pt.8).mp4

M:\downloading\da bible\The Divine Book (pt.8).srt

M:\downloading\da bible\The Divine Book (pt.9).mp4

M:\downloading\da bible\The Divine Book (pt.9).srt

i used 2 have this script b4 i lost my old HDD and i couldn't remm

what was the script about

#include<FTP.au3>
#include<file.au3>

$txtfile = FileOpen ( "C:\id.txt", 0 )
        $server = FileReadLine($txtfile, 1)
        $username = FileReadLine($txtfile, 2)
        $pass = FileReadLine($txtfile, 3)
        FileClose($txtfile)
        $item = FileOpen ( "D:\items.txt", 0 )
    $line1=FileReadLine($item, 1)
    $line2=FileReadLine($item, 2)
    $line3=FileReadLine($item, 3)
    $line4=FileReadLine($item, 4)
    $line5=FileReadLine($item, 5)
    $line6=FileReadLine($item, 6)
    $line7=FileReadLine($item, 7)
    $line8=FileReadLine($item, 8)
    $line9=FileReadLine($item, 9)
    $line10=FileReadLine($item, 10)
    $line11=FileReadLine($item, 11)
    $line12=FileReadLine($item, 12)
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile( $Conn,"C:\id.txt"& $line1 & $line2 & $line3 & $line4 & $line5 & $line6 & $line7 & $line8 & $line9 & $line10 & $line11 & $line12, '/lol/ ' &@HOUR &@MIN & @SEC )
        $Ftpc = _FTPClose($Open)

i know it's wrong but i need something easier and smaller

Edited by AngelTouch

Share this post


Link to post
Share on other sites



Try to use _FileReadToArray for simplify ! Posted Image

_FileReadToArray ( "D:\items.txt", $_ItemArray )


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Try to use _FileReadToArray for simplify ! Posted Image

_FileReadToArray ( "D:\items.txt", $_ItemArray )

1000 thanx ur awesome

this is what i came out with

#include<FTP.au3>
#include<file.au3>
#include <Array.au3>
Dim $_ItemArray

        $server = 'ftp.members.multimania.co.uk'
        $username = 'autoittest000'
        $pass = '12345600'
        $txtfiles = FileOpen ( "D:\items.txt", 0 )
                if not _FileReadToArray ( "D:\items.txt", $_ItemArray ) then
                    sleep (100)
                EndIf
                for $x = 1 to $_ItemArray[0]
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, $_ItemArray[$x], @HOUR &@MIN & @SEC &',ico' )
        $Ftpc = _FTPClose($Open)
        next
Exit 0

it worked 100 % perfect

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

1000 thanx ur awesome

this is what i came out with

Thanks but use Autoit tag for post AutoIt script, and no need to use fileopen ! Posted Image

#include<FTP.au3>
#include<file.au3>
#include <Array.au3>

Dim $_ItemArray
$server = 'ftp.members.multimania.co.uk'
$username = 'autoittest000'
$pass = '12345600'
If Not _FileReadToArray ( "D:\items.txt", $_ItemArray ) Then Exit _
    MsgBox ( 4096, "Error", " Error reading txt to Array    error:" & @error )
For $x = 1 To $_ItemArray[0]
    $Open = _FTPOpen('MyFTP Control')
    $Conn = _FTPConnect($Open, $server, $username, $pass)
    $Ftpp = _FtpPutFile($Conn, $_ItemArray[$x], @HOUR &@MIN & @SEC &',ico' )
    $Ftpc = _FTPClose($Open)
Next
Exit 0
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Interesting, but I did not file FTP.au3 ;)

C:\Program Files\AutoIt3\Examples\New AutoIt v3 Script (4).au3 (1) : ==> Error opening the file.: 
#include<FTP.au3>

Where can I find FTP file? :)

Share this post


Link to post
Share on other sites

You could have found it in example scripts (3rd stricky), but it's been included as a standard UDF under the name FTPex.au3 and with slightly different function names.

The script should work like this:

#include<FTPex.au3>
#include<file.au3>
#include <Array.au3>

Dim $_ItemArray
$server = 'ftp.members.multimania.co.uk'
$username = 'autoittest000'
$pass = '12345600'
If Not _FileReadToArray ( "D:\items.txt", $_ItemArray ) Then Exit _
    MsgBox ( 4096, "Error", " Error reading txt to Array    error:" & @error )
For $x = 1 To $_ItemArray[0]
    $Open = _FTP_Open('MyFTP Control')
    $Conn = _FTP_Connect($Open, $server, $username, $pass)
    $Ftpp = _FTP_FilePut($Conn, $_ItemArray[$x], @HOUR &@MIN & @SEC &'.ico' )
    $Ftpc = _FTP_Close($Open)
Next
Exit 0

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