# Unable to access image uploaded to Sendbird from .net library

**URL:** https://community.sendbird.com/t/unable-to-access-image-uploaded-to-sendbird-from-net-library/946
**Category:** .Net
**Tags:** chat-sdk, dotnet
**Created:** [September 14, 2020, 1:59am UTC](https://community.sendbird.com/t/unable-to-access-image-uploaded-to-sendbird-from-net-library/946 "2020-09-14T01:59:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![angelo.sb0401](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@angelo.sb0401](https://community.sendbird.com/u/angelo.sb0401)
#### Post date: [September 14, 2020, 1:59am UTC](https://community.sendbird.com/t/unable-to-access-image-uploaded-to-sendbird-from-net-library/946/1 "2020-09-14T01:59:14Z")

</div>

I’m developing an Android application using Xamarin.Android, hence I’m using SendBird’s .net library. I have implemented a function to send a ‘FileMessage’ (image, in particular) from local phone directory path. The issue I’m having is when I’m trying to display the ‘FileMessage’ in ‘OnMessageReceived’ event in the ‘ChannelHandler’. I was able to get the URL of the ‘FileMessage’ in the said event, but I can’t access the stream from the URL.

Here is the function that I use to access the URL:

```
private byte[] getBitmapFromURL(String src)
        {
            try
            {
                URL url = new URL(src);
                HttpURLConnection connection = (HttpURLConnection)url.OpenConnection();
                connection.DoInput = true;
                connection.Connect();
                Stream input = connection.InputStream;
                MemoryStream memoryStream = new MemoryStream();
                input.CopyTo(memoryStream);
                return memoryStream.ToArray();

            }
            catch (Java.IO.IOException e)
            {
                e.PrintStackTrace();
                return null;
            }
        } 

```

The function above throws an IOException when it reached connection.InputStream:  
{Java.IO.FileNotFoundException: [https://file-ap-9.sendbird.com/bcb2d8e2a41a4561b4608e09a8c81313.jpg](https://file-ap-9.sendbird.com/bcb2d8e2a41a4561b4608e09a8c81313.jpg)  
at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue\* args) [0x0006e] in :0  
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue\* parameters) [0x0002a] in :0  
at Java.Net.URLConnection.get\_InputStream () [0x0000a] in :0  
— End of managed Java.IO.FileNotFoundException stack trace —  
java.io.FileNotFoundException: [https://file-ap-9.sendbird.com/bcb2d8e2a41a4561b4608e09a8c81313.jpg](https://file-ap-9.sendbird.com/bcb2d8e2a41a4561b4608e09a8c81313.jpg)  
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251)  
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)  
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:26)  
}

Here are some details from the FileMessage that I could see when I debug my program:

 ![SB_error_1](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/5d03888efe481c72c9fe06d27a3dcbebd0812923.png)

Please let me know if there is any specific way to access the image stream from images uploaded to Sendbird, or if there is anything else I could provide.

---

<div class="post-metadata">

### Author: ![Eric](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/eric/32/380_2.png) [@Eric](https://community.sendbird.com/u/Eric)
#### Post date: [September 29, 2020, 11:27pm UTC](https://community.sendbird.com/t/unable-to-access-image-uploaded-to-sendbird-from-net-library/946/2 "2020-09-29T23:27:06Z")

</div>

I have the same question and do not see this subject in the [SB.NET](http://SB.NET) documentation.

I want to be able to download the image from FileMessage.URL.

It seems like I am missing a [SB.NET](http://SB.NET) SDK method call that would be used specifically for this. If I try to just download the URL, then I get access denied.
