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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

How to insert additional path in If statement using ASP?

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
Stiebel Eltron
Asked:
Stiebel Eltron
  • 4
  • 4
1 Solution
 
khairilCommented:
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
 
Stiebel EltronAuthor Commented:
@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
 
khairilCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Stiebel EltronAuthor Commented:
Still the same. Haven't seen the word "photo", lol...
0
 
khairilCommented:
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
 
Stiebel EltronAuthor Commented:
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
 
khairilCommented:
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
 
Stiebel EltronAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now