[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to add variable file name to <a herf>

Posted on 2007-11-26
3
Medium Priority
?
557 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
3 Comments
 
LVL 17

Accepted Solution

by:
contactkarthi earned 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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