AnsweredAssumed Answered

How to attach an image to runtime geodatabase?

Question asked by tresreis on Feb 3, 2017
Latest reply on Feb 7, 2017 by tresreis
 We are unable to attach an image file to the geodatabase on ArcGIS Runtime SDK for .NET v100(Xamarin). I am sending the code we have worked.
 
FeatureQueryResult qfr = await gft.QueryFeaturesAsync(queryParams);
            Feature onerecord = qfr.FirstOrDefault();
           
            ArcGISFeature a = onerecord as ArcGISFeature;
            if (a.CanEditAttachments)
            {
                Debug.WriteLine("true");
            }
            Byte[] b1;
            using (var memoryStream = new MemoryStream())
            {
                file.GetStream().CopyTo(memoryStream);
                file.Dispose();
                b1 = memoryStream.ToArray();
            }
           
           await a.AddAttachmentAsync(filename, @"image/", b1);
Please see the attached image for the details

Attachments

Outcomes