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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
HP-11021721-0 Profile Picture

HP-11021721-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans