How to change client file name to server file name

nightrodnightrod Member Posts: 68
I want to create a text file on a location that the user can choose.
using file management.savefiledialog the user can select location.

when the location is on a server drive the location is mentioned as
'K:\Data\file.txt'

the textfile is created as temporary server file.
when finished i want tod copy the temp file to the clientfilename.

the server cant find the path to 'K:'

when the filename is changed to \\server1\data\file.txt the server can find it and it works.


is there a function to change 'K:\Data\file.text' to '\\server1\data;file.txt'?

hopefully this description is clear enough.

thanks.



Answers

  • loggerlogger Member Posts: 126
    Hi @nightrod ,
    Have you tried to use functions from codeunit 419 "File Management"? Functions in this codeunit let you easily copy files between client machine and server machine.
    Let's go!
  • nightrodnightrod Member Posts: 68
    Yes i do use that codeunit.
    But i cant find a function to change the filename from client side to server side.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Whatever location user selects in SaveFileDialog call is the location visible from client PC. Always. It does not matter where the file is physically stored, K:\ might some mapped network drive, but whatever the SaveFileDialog function return it is how the file is seen from the local client point of view.

    If you want to copy the file to \\server1\data location you can use C419.UploadFileSilentToServerPath

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.