0

I am upoloading image to below location:
Location:\MyPC-pc\u165121142\MyFolder\pid\11\Profile\FImage\
But I cannot show the image from above location.
below is my control:

<asp:ImageButton ID="ImgImage"   runat="server" />

I am checking using below method for file exists or not(it works) but when I set image file location to ImageUrl property, I can not see image in browser.

if(System.IO.File.Exists("\\MyPC-pc\u165121142\MyFolder\pid\11\Profile\FImage\Koala6192013104451AM.jpg"))
    {
        ImgImage.ImageUrl="\\MyPC-pc\u165121142\MyFolder\pid\11\Profile\FImage\Koala6192013104451AM.jpg";
    }

note: This folder (u165121142) is in network. I have given it full rights

2
  • how bout this ? stackoverflow.com/questions/3278654/… Commented Jun 19, 2013 at 7:45
  • thanx for the reply by this link is not useful for me. I am storing image on other computer's drive(suppose in your computer's drive(Having permission)). I successfully completed this task. Now I want to use this image from that location where i stored. Note: Hosting computer and the other computer in which i am storing image are in same network. Commented Jun 19, 2013 at 8:07

2 Answers 2

0

The user's browser needs to be able to retrieve from the URL. It's retrieved at display time.

You could either put the file on a web server and use an http url, or you might be able to use a file: url. Either way, the browser won't retrieve from a disk file directly.

Sign up to request clarification or add additional context in comments.

Comments

0

Is that your actual code? 'Cause you probably need to use double backslash, like:

if(System.IO.File.Exists("\\\\MyPC-pc\\u165121142\\MyFolder\\pid\\11\\Profile\\FImage\\Koala6192013104451AM.jpg"))
    {
        ImgImage.ImageUrl="\\\\MyPC-pc\\u165121142\\MyFolder\\pid\\11\\Profile\\FImage\\Koala6192013104451AM.jpg";
    }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.