Urgent-How to access image from the server folder

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

Manish Songar via .NET 247

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 (\Orchid_Image) store in the same place
into the application root (server machine) like
c:\inetpub\wwwroot\OrchidDB\Orchid_Image. I am using repeter control
for show images. I already use server.Mappath but still when I run my
application in client machine it still look for the image on client
machine itself.
When I run apllication on server images are display in repeter control but when i run it on client machine it dose not display image.
Once again i show you my code please solve this problem.
it is urgent..

Dim dt As New DataTable("Orchid")
Dim FullPath As String
Dim col As DataColumn
Dim Rowimg As DataRow
'Use strimg --got images name from sql server with comma
'delemeter
Dim strtxt As String = StrImg
'split image name here
Dim StrString() As String = Split(strtxt, ",")
col = New DataColumn("image", GetType(String))
dt.Columns.Add(col)
For Each strtxt In StrString
'It work on server but not work on client machine
FullPath = Server.MapPath("Orchid_Image/" & strtxt)
Rowimg = dt.NewRow
Rowimg.Item("image") = FullPath
dt.Rows.Add(Rowimg)
Next
RepImg.DataSource = dt
RepImg.DataBind()
 
E

Eliyahu Goldin

You don't need to use MapPath. The image url should be set to server
location, like

Orchid_Image/MyImage.jpg

That's it.

Eliyahu

Manish Songar via .NET 247 said:
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 (\Orchid_Image) store in the same place
into the application root (server machine) like
c:\inetpub\wwwroot\OrchidDB\Orchid_Image. I am using repeter control
for show images. I already use server.Mappath but still when I run my
application in client machine it still look for the image on client
machine itself.
When I run apllication on server images are display in repeter control but
when i run it on client machine it dose not display image.
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top