Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1053581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:16:30+00:00 2026-05-16T17:16:30+00:00

My website is in the root directory, which is /www.lebmotor.com/web/content/ . I am using

  • 0

My website is in the root directory, which is /www.lebmotor.com/web/content/.

I am using this:

Dim appPath As String = HttpContext.Current.Request.ApplicationPath  
Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/"  

to get the path and it’s working very well.

But when I create a new sub-folder and copy some pages from the root directory into the sub-folder, my images are not displayed because the path has changed.

This is the link from the page in the root directory:

http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM

and this is the link from the page in the sub-folder:

http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM

So how can I make the link in the sub folder like this:

http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM


Let me explain more about this. First, I have two directories and both of them have been set as application directories, as you can see here in the photo:

The /ar sub-folder is an application and it’s a copy of the original one in the Content directory.

In the ar/App_code there is a class with the name MGImages.vp, and course it’s a copy of the original one in Content/App_code. This class’ job is to display photos from the Upload sub folder.

This is the code which will save the path of the photo:

Dim appPath As String = HttpContext.Current.Request.ApplicationPath  
Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/"  
If ImageType.ToUpper = "TN" Then  
    directory += "TN/"  
ElseIf ImageType.ToUpper = "LG" Then  
    directory += "LG/"  
Else  
    directory += "OT/"  
End If  

This class is working very well in the Content directory because this will give me the right path:

http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM

All photos should be saved in the Content/Upload folder for both directories’ Content/ar

But in the ar directory it will give me the wrong path:

http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM

Where the goal is to make the path like this one:

http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM

I want it to display the photos from Content/upload, not from the content/ar/upload.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:16:31+00:00Added an answer on May 16, 2026 at 5:16 pm

    When you first construct the image path, you can remove the ar path:

    Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/" 
    directory = directory.Replace("/ar/", "")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My dilema: In .htaccess in my website's root: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
I have a content management application in the root of my website, and I'm
I am trying to get the path to a folder in my website root
My website was recently attacked by, what seemed to me as, an innocent code:
Files: Website\Controls\map.ascx Website\App_Code\map.cs I'd like to create a strongly typed instance of map.ascx in
My website makes a lot of requests. I often need to cancel all current
The website works with Wemf and Google Analytics, but they are giving me very
A website of mine will host the usual images, javascript and CSS stylesheets in
My website has been giving me intermittent errors when trying to perform any Ajax
Our website uses Perl to provide a simple mechanism for our HR people to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.