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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapped Drive

Status
Not open for further replies.

05082000

Technical User
Mar 28, 2002
8
US
I am writting this code where i want to change this C: drive which is local drive to X drive which is mapped Drive and serach a po from the mapped Drive instead of the local drive.

<cfif fileexists&quot;c:/inetpub/ (po_no)#.pdf&quot;) eq &quot;Yes&quot;>
<a href=&quot;../Docs/po/#cust##trim(po_no)#.PDF&quot;>View PO</a>
<cfelse>
No Match
</cfif>

thank You
 
If X: isn't mapped to somewhere under your webroot (ie - it's just mapped as a drive on the server), then the anchor tag isn't going to be able to fetch it the way you have it coded.

Two solutions:

1) map the volume that you currently have mapped as drive X: as a directory under webroot. Depending on the OS you're running, this could be a trivial task, or it could be dang difficult.

1b) keep the volume mapped as drive X: and revise the config file for your web server to include drive X: as an additional webroot (in affect using the web server to do #1, above). Depending on the web server, this could be a trivial task, or it cuold be dang hard ;-)


2) since you're talking about a PDF file that doesn't really need to be processed by a web server anyway, you might be able to recode the anchor to use the FILE protocol instead of HTTP:
Code:
<cfif fileexists&quot;x:/inetpub/[URL unfurl="true"]wwwroot/ltw/docs/po/#cust##trim[/URL] (po_no)#.pdf&quot;) eq &quot;Yes&quot;>  
<a href=&quot;FILE://x:/inetpub/[URL unfurl="true"]wwwroot/ltw/docs/po/#cust##trim[/URL] (po_no)#.pdf&quot;>View PO</a>
   :
but the planets and moons have to be aligned perfectly and you will have had to make an offering to the web god Hatimel for it to work.

Just kidding ;-)

It will only work in certain circumstances, however. The user must have the same volume mounted as drive X: on their local machine, and have permissions to at least view the directory/file. So it's only really useful if you're working in, say, an intranet environment and all your users have the same network connections. But I throw it out there just in case. Otherwise it's gotta be #1.


Oh... I guess there's a #3, too. Set drive X: up as an FTP directory. Then you can either code the anchor using FTP, or use CFFTP to pull the file to the webroot volume and serve it from there.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top