Hi!
Using url(string) as parameter, works correctly, but using Stream it doesn't.
Code:
//give to ReadStream() the picture in bytes...
Stream ReadStream(byte[] bytes){
Stream s = new MemoryStream();
for (int i = 0; i < bytes.Length; i++)
{
s.WriteByte(bytes[i]);
}
s.Position = 0;
s.Close();
return s;
}
And send it:
Stream stream = GetStream(); //here does many things and finally ReadStream to get the bytes array
uploadService.UploadFileForUser("picture","name",stream,UploadFileType.IMAGE,"picture description",new UploadPictureCallBack());
Error:
NullReferenceException: Object reference not set to an instance of an object
com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW.ExecuteMultipart (System.String name, System.IO.Stream stream, System.Collections.Generic.Dictionary`2 queryParams, System.Collections.Generic.Dictionary`2 postParams, System.Collections.Generic.Dictionary`2 headerParams, System.String url, System.String accept, App42CallBack callBack)
com.shephertz.app42.paas.sdk.csharp.upload.UploadService.UploadFile (System.String name, System.IO.Stream inputStream, System.String fileType, System.String description, App42CallBack callBack)
PictureUploader.UploadProfilePicture (System.IO.Stream stream) (at Assets/EtorkiGames/Assets/Scripts/Others/PictureUploader.cs:74)
PictureUploader.Update () (at Assets/EtorkiGames/Assets/Scripts/Others/PictureUploader.cs:22)
Any help? :)