I'm using AWS Unity (v3.3.50.0): S3 SDK (AWSSDK.S3.3.3.5.4.unitypackage) downloaded from https://aws.amazon.com/mobile/sdk/. My Unity version is 5.5.1.
I want to download an image placed on S3 bucket, bucket is configured and can be downloaded. And I see the string as data in response.
But I cannot able to convert the returned StreamReader to UnityEngine.UI.Image.sprite OR UnityEngine.UI.RawImage.texture in S3 sample GetObject() function.
private void GetObject()
{
ResultText.text = string.Format("fetching {0} from bucket {1}", SampleFileName, S3BucketName);
Client.GetObjectAsync(S3BucketName, SampleFileName, (responseObj) =>
{
string data = null;
var response = responseObj.Response;
if (response.ResponseStream != null)
{
using (StreamReader reader = new StreamReader(response.ResponseStream))
{
data = reader.ReadToEnd();
}
ResultText.text += "\n";
ResultText.text += data;
}
Debug.Log("GetObject: " + data);
});
}
help required regarding this :)
Images on S3 bucket are in PNG format. But in future JPG, JPEG format support have to enable.