Solved

how to add variable file name to <a herf>

Posted on 2007-11-26
3
549 Views
Last Modified: 2012-05-12
Hi
what i want to do is to add link to afile in my jsp page, the path of my files are constant for example
"c:\uplods" , but the file name may change , how i can concatenat the path with the file name so the user can click on the filename and the file opend
<a hert="c:\uploads"> filename </a>
0
Comment
Question by:master_programmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
contactkarthi earned 500 total points
ID: 20351624
<a href="c:\\uploads\\"<%=filename%>> <%=filename%></a>
0
 
LVL 13

Expert Comment

by:R7AF
ID: 20351805
Well that won't work. First you link to a local file. If the user clicks on it, the link is local for the visitor, so it would link to a file on the user-computer. Probably there is no such file. Second, this is not allowed in most browsers. You cannot link to a local file (using C:) unless the page is opened locally (with file:/// instead of http://).

What webserver do you use? Tomcat? If so you can simply create a mapping to that directory, and then use a relative path.
0
 

Author Comment

by:master_programmer
ID: 20352560
Yes i am using tomcat and my web site is local, what do you mean by:
 create a mapping to that directory, and then use a relative path.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Learn why we support net neutrality and why the topic is important to all internet users.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question