Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to upload list of multiples files from txt/csv file with ftp

Status
Not open for further replies.

brunello67

Vendor
Jul 30, 2021
7
IT
Hi everybody
I'm asking your help because i have a list of files to be uploaded with a script but i dont have any idea how to do it. (i'm not a programmer [ponder])

I can create a list in txt or csv.

can you give me a script to do it?


example: files.txt

123456.jpg
767676.jpg
929292.jpg

thanks a lot
Bruno
Italy
 
When you say you have no ide, do you mean you don't know how to loop through the file nor how to ftp the files contained therein? Or is it just the FTp you are struggling with?
 
i mean that i'm not a programmer so i'm not able to write a vbscript code so thats the reason why i'm asking in this forum.

i can make a list in txt or csv with all the files to be transferred via ftp but then i need a vbscript code to do it automatically

i hope this will help you
thanks a lot strongm
 
a vbscript that will transfer all the file that are in the txt or csv list file
 
Something like:

Code:
[COLOR=blue]Public Sub ftp()
    Dim ftpFolder
    Dim fso
    Dim path
    
    path = "d:\downloads\deleteme\" [COLOR=green]' path to wherever your files are stored[/color]
    
    With CreateObject("shell.application")
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set ftpFolder = .Namespace("ftp://ftpsite.com")
        [COLOR=green]' Set ftpFolder = .Namespace("ftp://username:password@ftpsite.com")[/color] [COLOR=green]' use this pattern instead if ftp site requires a username and password[/color]
        With fso.OpenTextFile(fso.BuildPath(path, "files.txt")) [COLOR=green]' I've assumed text file with list of files is  in same folder as the files themselves for the purposes of this example[/color]#
            Do Until .AtEndOfStream
                ftpFolder.CopyHere fso.BuildPath(path, .ReadLine)
            Loop
        End With
    End With
End Sub[/color]
 
thanks.

i've tried but it doesnt work (even if there's no error warning) so i dont understand why
can you please write me the exact string of ftp access details if they are something like:

user: GGGGGGGGGG
password: KKKKKKKKK

ftp host: example.nuun.cloud

ftp folder: 333
is it right this one?:

ftp://GGGGGGGGGG:KKKKKKKKK@example.nuun.cloud/d2/
 
>ftp host: example.nuun.cloud
>ftp folder: 333
>user: GGGGGGGGGG
>password: KKKKKKKKK

Ok, so you want a path on the ftp server, so should be:

Code:
ftp://GGGGGGGGGG:KKKKKKKKK@example.nuun.cloud/333
 
Unfortunately it works just fine here, tested before posted (against a public FTP server that requires a username and password), and I can't replicate your problem (except by feeding it an incorrect ftp site .

Quick test you might try, though. Do you sytill have Intrernet Explorer on your PC? If so, it is one of the few browsers that still supports the FTP protocol, so try launching i.e. and try the problematic URL in it to see what happens. Alternatrively feed the URL to Windows File explorer (which also supports FTP)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top