Solved

How to insert additional path in If statement using ASP?

Posted on 2011-09-22
8
322 Views
Last Modified: 2012-05-12
Dear EE experts,

We would like to ask for tech support on how to insert additional path into this line:
Response.Write "<a href=""" & download1 & """>DOWNLOAD</a>"

Please see the attached code & screenshot for more details.
If a user uploads a photo, it will go to this location: ..\ASIA\photo\DOWNLOAD
Then from the db it started @ DOWNLOAD. I would like to add "../photo/
Because at this moment, user uploads, then try to download the original file, the location would be http://sitename/iphoto/asia/DOWNLOAD.... it should be http://sitename/iphoto/asia/photo/DOWNLOAD...

Kindly advise on how to resolve this case...

Thank you & hope to hear from experts soon...
<%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & download1 & """>DOWNLOAD</a>"
						
						End If
    					%>

Open in new window

download-location.jpg
0
Comment
Question by:Stiebel Eltron
  • 4
  • 4
8 Comments
 
LVL 13

Expert Comment

by:khairil
ID: 36579036
Hi,

Just use replace or concat function. Of course the name is not concat in ASP.

To user replace function

Response.Write "<a href=""" & Replace(download1, "asia", "asia/photo") & """>DOWNLOAD</a>"



0
 

Author Comment

by:Stiebel Eltron
ID: 36579101
@khairil, thanks for the response. But the result is still the same, I tried to browse it in IE & even in Google Chrome, but both gave me an error result...
:-(
0
 
LVL 13

Expert Comment

by:khairil
ID: 36579239
I think the word "asia" is not in the string,

Try this instead:
Response.Write "<a href=""" & Replace(download1, "download", "photo/download") & """>DOWNLOAD</a>" 

Open in new window


Clear cache from your browser, just in case.
0
 

Author Comment

by:Stiebel Eltron
ID: 36579275
Still the same. Haven't seen the word "photo", lol...
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Expert Comment

by:khairil
ID: 36579317
can you give me some sampel data and code that you use to generate the "download1" variable?

if possible, can i browse to that page to mention here? so that i can support you better.
0
 

Author Comment

by:Stiebel Eltron
ID: 36579393
I'm sorry but we haven't uploaded it yet, but you can see the screenshot for you to see the link on the lower left, I need to have the additional "/photo/" after the asia.
And you can check this thread ID: 27321625, it's the same page, but different subject...
You can see some scripts from there...
download-location2.jpg
0
 
LVL 13

Accepted Solution

by:
khairil earned 500 total points
ID: 36580586
i not sure if it is because of case sensitive, but worth trying

Response.Write "<a href=""" & Replace(download1, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>" 

Open in new window


By default "replace" command  compare using binary, which means case sensitive.
0
 

Author Comment

by:Stiebel Eltron
ID: 36585316
Oh! It's really weird! Because yesterday I tried it with the word "download" in lower case, is not working, but now, we just changed it to UPPER CASE, and it's working now! Great!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 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

19 Experts available now in Live!

Get 1:1 Help Now