Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to connect to FTP Server and load all the files from the particular folder

Hi,

Please let me know how to automatically connect to ftp server and load all the files from that particular location.

I have a sample script but it is not working or connecting

let vDataFolder ='ftp://';

//

for each vFile in filelist('$(vDataFolder)*.xls*')

let vFileName = mid(vFile, index(vFile, '\', -1) + 1);

//define ODBC connection for Data Source by mentiong Variable

//ODBC CONNECT32 TO [Excel Files;DBQ=$(vFile)];

OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=True;Extended Properties="DSN=Excel Files;DBQ=$(vFile);DriverId=790;MaxBufferSize=2048;PageTimeout=5;"];

tables: 

SQLtables;

DISCONNECT;   

FOR i = 0 to NoOfRows('tables')-1

               

                LET sheetName = purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39));

               

                //IF wildmatch('$(sheetName)', 'Sales*') THEN 

                                Sales:   

                               

                                LOAD * ,  '$(vFileName)' as FileName

                               

                                FROM $(vFileName) (biff, embedded labels, table is [$(sheetName)]);

                //END IF                              

NEXT

DROP TABLE tables;  

NEXT

EXIT Script;

Please help me to solve this issue.

1 Reply
marcus_sommer

It's not possible in this way - have some explanations and alternatively here:

Re: For Each File in Filelist - FTP load is not working?

Re: FTP data import into script

- Marcus