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!

mappeddrive paths in filenames?

Status
Not open for further replies.

psteja2000

Programmer
Feb 1, 2005
82
US
Can anyone confirm mapped drive paths won't work?

I am having
a mapped drive Z -> \\servername\folder

When I use z:\filename in cfdirectory, it wouldn't work
But when I use \\servername\folder in cfdirectory, it works fine.

Is that how it is?


regards,
Teja
 
you did map it on the server right? not your desktop...

Beware of programmers who carry screwdrivers.
 
I mean my server now is my desktop..

on my machine, I have a drive mapped to \\servername\folder

and on my cfpages I am using cfdirectory directory="z:\folder1"

but it doesn't seem to work..any ideas?


regards,
Teja
 
I've never had much success using mapped drives for things like this. Since mapped drives are only available to the account that is currently logged in, it's a bad idea to try to use them. If you log off the server, then that map drive doesn't exist until you log back in, but \\servername\folder will always be there, regardless of wheter you're logged in or not.



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
I created the map under my windows account, and cf server too is running under the same account, I don't understand why it has a problem in recognizing the mapped drive paths..
:(

 
if it works using the servername (which is more portable from server to server) why would you want to use the maped method?

Beware of programmers who carry screwdrivers.
 
SimulatedFUn, I want to use a mapped drive so I dont have to make any changes on the coldfusion side of the web site when the pdfserver/folder path changes. I mean Z:\pdffolder is a much better interface than \\servername\folder\pdffolder.

Ecar, I have to use a specific windows account (apart from the localsystem account cf runs by default on) for cf to run anyway because only then the network machine is visible. So I cann't escape windows account dependancy anyway. I just don't understand why it wouldn't recognize mapped drive path inplace of UNCpath.

regards,
Teja
 
ok, do what i do in that case.

<cfset application.pdfPath = "\\servername\folder\pdffolder">

<cfdirectory directory="#application.pdfpath#">

If the pdf path changes, simply change it in the application.cfm file.... all done.

Beware of programmers who carry screwdrivers.
 
The ColdFusion Server only sees what is local on it's server. It doesn't recognize mapped drives, they only exist for a user, not the server. If the user is not logged in (regardless what user account CF is using), the drive does not exist and cannot be used. A service cannot imitate a user, only that user's permissions. Do you really want to leave your server logged in as you all of the time so that your application works? What happens if the server reboots? Your mapped drive disappears and your application stops working.



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top