How to access image into the server folder

  • Thread starter Manish Songar via .NET 247
  • Start date
M

Manish Songar via .NET 247

(Type your message here)
I am using asp.net. I am not storing image in sql server.I storeall the image in one folder. I want to access image from thatfolder to my client machine. Images folder (\Data_Image) storein the same place into the application root (server machine)like c:\inetpub\wwwroot\mywebapp\Data_Image. I am using repetercontrol for show images. I already use server.Mappath but stillwhen I run my application on client machine it still look forthe image on client machine itself.
can anybody solve my problem.
 
K

Kevin Spencer

I hate to tell you this, but your application root is not
"c:\inetpub\wwwroot\mywebapp\Data_Image". Your application is a web
application that resides in virtual directories. A URL points to a virtual
directory on the server, not a file location. If you use a file location,
that's what you're going to get. Take a look at the URL for your page. Do
you see any "C:" in there? A browser can display either local (to the local
file system) or remote (virtual directory via HTTP URL) files. How does the
browser know when they are local to the file system? When the URL is a file
path.

When building cars, it's best to know something about how the road works.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

(Type your message here)
I am using asp.net. I am not storing image in sql server.I store all the
image in one folder. I want to access image from that folder to my client
machine. Images folder (\Data_Image) store in the same place into the
application root (server machine) like
c:\inetpub\wwwroot\mywebapp\Data_Image. I am using repeter control for show
images. I already use server.Mappath but still when I run my application on
client machine it still look for the image on client machine itself.
can anybody solve my problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,087
Members
48,773
Latest member
Kaybee

Latest Threads

Top