Moving files from network drive(Only accessible on client) to locally (on server).

Phogue
Member Posts: 76
Hi.
I'm currently trying to browse a network drive to attach some files to a mail.
Currently I'm using the DotNet System.Object and System.IO.Directory and System.Collections.Generic.List to find the filepaths in the following way:
SysObj := SysDir.GetFiles(DirectoryPath);
SysList := SysList.List;
SysList.AddRange(SysObj);
FOR j:= 1 TO SysList.Count DO BEGIN
CurrentFile := FORMAT(SysList.Item(j-1));
END;
Since only the NAV clients have access to the network drives in which the files exist, RunOnClient has to be set to true for these DotNet data type variables.
I want to move these files to a drive on the same server the NAV server runs on, but I can't simply use System.IO.Directory.Move(file1,file2), since the client won't have access to the server's drives.
Is there any smart way of going about this, since I can't set the File datatype to RunOnClient = true?
Thank you in advance.
I'm currently trying to browse a network drive to attach some files to a mail.
Currently I'm using the DotNet System.Object and System.IO.Directory and System.Collections.Generic.List to find the filepaths in the following way:
SysObj := SysDir.GetFiles(DirectoryPath);
SysList := SysList.List;
SysList.AddRange(SysObj);
FOR j:= 1 TO SysList.Count DO BEGIN
CurrentFile := FORMAT(SysList.Item(j-1));
END;
Since only the NAV clients have access to the network drives in which the files exist, RunOnClient has to be set to true for these DotNet data type variables.
I want to move these files to a drive on the same server the NAV server runs on, but I can't simply use System.IO.Directory.Move(file1,file2), since the client won't have access to the server's drives.
Is there any smart way of going about this, since I can't set the File datatype to RunOnClient = true?
Thank you in advance.
0
Best Answer
-
@phogue If i'm not wrong, you should be able to handle this with the CUs
- "3-Tier Automation Mgt." with BlobImport and BlobExport
- "Common Dialog Management" for User File Selecting Window.
Maxime JUND
Talent Business Solutions
Technical Expert of Microsoft Dynamics 365 Business Central
Website | Mail | LinkedIn1
Answers
-
Hello @Phenno
What version of NAV are you running?
If you run a newer version of NAV or BC, then you can use Codeunit 419 File Management.
There is a function called UploadFileSilentToServerPath, where you can pass your client path and your server path.
This will upload the file.For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.2 -
Hello
What version of NAV are you running?
@SanderDk Thanks for the response, I'm currently on 6.02, with no File Management CU unfortunately, but I'll grab the function code from a newer version, and try using it in the 6.02, since it only requires dotnet objects and not data types such as blobs.1 -
@phogue If i'm not wrong, you should be able to handle this with the CUs
- "3-Tier Automation Mgt." with BlobImport and BlobExport
- "Common Dialog Management" for User File Selecting Window.
Maxime JUND
Talent Business Solutions
Technical Expert of Microsoft Dynamics 365 Business Central
Website | Mail | LinkedIn1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions