I'm needing to move a file from an FTP site to a local working directory for integration into Dynamics GP v10. I believe I have my "Before Integration" script written correctly but I'm getting "Bad File Name or Number" when the integration is run. Below is my script:
Dim pFSO
Dim sFileName
Dim sFTPUser
Dim sFTPPass
Dim sFTPServ
Dim sFTPDir
fNum=FreeFile
Set pFSO = CreateObject("Scripting.FileSystemObject")
sFileName = "<FileName>.csv"
sFTPUser = "UID"
sFTPPass = "PASS"
sFTPServ = "<FTP Server IP>"
sFTPDir = "/working/directory/"
sSourcePath = "ftp://" & sFTPUser & ":" & sFTPPass & "@" & sFTPServ & sFTPDir
sDestinationPath = \\networklocation\workingfolder
If pFSO.FileExists (sDestinationPath & FileName) Then
Wscript.Echo "File already exists."
Else
pFSO.MoveFile sSourcePath & sFileName, sDestinationPath & sFileName
End If
I'm not sure what I've gotten written incorrect and would appreciate all insight into this.
Many thanks,
Sean
*This post is locked for comments
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156