Link to home
Start Free TrialLog in
Avatar of Amandina
AmandinaFlag for Denmark

asked on

Save pdf file to other location

Hi,
Using Delphi 10.
The user point to a pdf file(Tfilebox)  and I want to save the file they point to on  another location on the network without a dialog box, only code. Copy the file to another location.
How can I do that?
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Just call CopyFile function:
CopyFile(PChar(filebox.FileName), PChar('c:\somewhere\'+ExtractFileName(filebox.FileName)), False);

Open in new window


CopyFile allow to change to another name, but I use ExtractFileName to get original name and concat with destination path.
Avatar of Amandina

ASKER

Thank you very much.

It works fine on my local drive.
Now I am trying to copy the file to antoher server using '\\servername\directory\filename.pdf'
It does not copy the file and I do not get any error message.
The directory on the server is shared.

Any hints?
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial