Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer file across network through dialog

Status
Not open for further replies.

qwertyjjj

Programmer
May 27, 2005
70
GB
Hi
I need to allow users to select a file from their desktop and save it to a fixed network location (they should not be allowed to change this).
Ideally, through a select file dialog, then save.

Any recommended solutions to go about this?
Maybe an Open dialog that allows them to select the file, but it only records the filename.
Then a hidden save dialog that grabs that string and saves it across the network?
 
You don't need a dialog box for the save as the users aren't selecting anything.

I'd use a File Open dialog to select the file and store the current filepath and then a FileCopy statement to copy the file to the predetermined network location and then (optionally) a Kill statement to delete the original file.

Ed Metcalfe.

Please do not feed the trolls.....
 
Is FileCopy part of the dialog's functions or a separate function within VBA?
 
also, how do you copy it to a network drive that might not be mapped on every client PC?
 
FileCopy is a separate VBA function. The FileOpen dialog will return the filepath of the selected file, nothing else.

Providing the user has access to the area it doesn't matter whether the drive is mapped or not - use UNC filepaths in the following format:

\\ServerName\DirectoryName(s)...\FileName

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top