sync blob data from SQLite to SQLServer through Azure App Services, Xamarin.Forms

blmilesblmiles Member
edited February 13 in General

Hello,

I have an object with various fields that sync with an Azure App Services db though Node.js
All fields' data is transferred into SQLServer db and I can pull that data to a different device through the sync mechanism.

Explanation: One field on my data class is type byte[]. I save a .png bitmap image as a byte[] array then want to recreate that .png file from that data.
This works locally going from actual .png file to byte[] field then recreating the .png file from byte[] data and displaying.

Problem. The byte[] field data is never transferred into the SQLServer db on sync.

Also, this IMobileServiceSyncTable<Picture> pictureTable; discovers and creates the fields on the Picture table through the Node.js API.
It created a nvarchar(max) field for the byte[] array property on my picture class.

Question: is there a way of using IMobileServiceSyncTable and the Microsoft.WindowsAzure.MobileServices to include the byte[] array field in the data sync method(s), ie: on this call await this.client.SyncContext.PushAsync(); ? I don't get any errors on the sync, data transfers for all fields EXCEPT the byte[] field.

I don't want to use the blob transfer service as i want each .png as a blob on the related record. This might now be ideal but not sure how else I can save/transfer pics to Azure App Services and down again if a user changes devices (which is what the whole sync mechanism facilitates) AND keep them related to the relevant db records.

Any idea / advice would be most helpful!

Thanks

Sign In or Register to comment.