web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How do I move a file from an FTP site to a local network location?

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
mtabor Profile Picture

mtabor 1

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans