Solved

how to add variable file name to <a herf>

Posted on 2007-11-26
3
508 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now