Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Qlikview Data to FTP

Good Evening All,

I have once use case, wherein we need to export list of users or any object data to secured FTP. Is there any possibility of achieving this either using macro or some other way.

Any help regarding this will be widely appreciated


Thanks in Advance


Manoj

8 Replies
its_anandrjs

Hi,

Try to use bat files here after getting export the excel file then store it into any folder and then by bat file export to the FTP location.

Regards

Anand

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Please could you provide some sample, how to download data using macro and then intern call batch file to transfer data to ftp

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

We are doing SFTP to transfer files between a Unix environment and Windows environment. Unless we unintentionally overcomplicated things, its not that simple. There is quite a lot of documentation if you are prepared to spend some time googling.

  • Get a unix user account (ie one with a password that expires) and a unix system account (static password)
  • Use Putty to log onto the Unix box and use PuttyGen to create a pubic key / private key pair (Google Putty) for the system account
  • Set up the public key on the Unix box
  • Build a .NET executable wrapper around an SFTP utility (WinSCP) to pass the encrypted private key to Unix for authentication (sorry that code is not mine and is proprietary) Google WinSCP
  • Create a bat or cmd file
  • From the bat file, call the executable with the encrypted key file as a parameter (as well as the source document and target). The private key will authenticate executable with the system account.


As I said, its not that simple to set up, but it does work.


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Thanks for information. Pls could you let me know how to call batch file & Qlikview macro should wait until ftp process stops.

Thanks in Advance

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Can you provide some sample code to call batch file having ftp command from Qlikview macro

Not applicable

My code:

'****************FTP Upload

Set oShell = CreateObject("Shell.Application")

Set objFSO = CreateObject("Scripting.FileSystemObject")

'Path to file or folder to upload

path = "C:\directory\file.csv"

Sub FTPUpload

On Error Resume Next

Const copyType = 16

'FTP Wait Time in ms

waitTime = 80000

'Configuración FTP

FTPUser = "ftp.user"

FTPPass = "pass"

FTPHost = "host ftp"

FTPDir = "/"

strFTP = "ftp://" & FTPUser & ":" & FTPPass & "@" & FTPHost & FTPDir

Set objFTP = oShell.NameSpace(strFTP)

'Upload single file    

If objFSO.FileExists(path) Then

Set objFile = objFSO.getFile(path)

strParent = objFile.ParentFolder

Set objFolder = oShell.NameSpace(strParent)

Set objItem = objFolder.ParseName(objFile.Name)

objFTP.CopyHere objItem, copyType

End If

WScript.Sleep waitTime

End Sub

Ribeiro
Specialist
Specialist

Please,
This macro works 100%
I need to clean the folder before including the file

FTPDir = "/ public_html"

before inserting a new one.
You have the friend to help

Neves
vaibhav11
Contributor
Contributor

Can we do it for a Excel files stored in a folder? Do we need  any oither installation for the same?

or directly export a chart from Application?