Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

I want to store an image captured with the phone cam in a SQL Server database.
Simply mapping the image asset to the SQL Server database filed does not do the trick.

Any suggestions are welcome.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How to store a image base64 from an image asset to sql server database field type CLOB?

Hi Bernie,

I could be wrong however I'm not sure that this would be any different than going to the Appery database.

What we always do one retrieving an image from the camera or any other source... Is to map it to two places... First... To the image on the UI and second to local storage.

Then... Upon updating the database or inserting a new record... We always retrieve the image from local storage as opposed to from the screen element...

Likely you've already tried that but just in case...

Happy Thursday,

Bruce

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

Bruce,

That is exactly what I did and this works fine when using the Appery database.
Doing the same with a SQL Server database does not work in my example though.
Thanks for the comment - sure that will be helpful to others one day.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How to store a image base64 from an image asset to sql server database field type CLOB?

Thanks for the quick reply... So during your update... Does your SQL server database respond with an error?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How to store a image base64 from an image asset to sql server database field type CLOB?

I.e. I Assume you have 'on error' JavaScript that captures the error and gives you adequate information to debug from a Chrome debugging session ....

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

When I test the API service with an image base64 string I get

{
"code": "AE009",
"message": "Connection reset",
"status": "BAD_REQUEST"
}

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

It seems to be a time out issue. I just tuned down the quality and the picture size of the camera and it worked. Any idea on where to jack up the time out?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How to store a image base64 from an image asset to sql server database field type CLOB?

In general... Timeouts on the Appery platform... Are controlled by your subscription level... The more you pay per month the longer your time out period is.

I guess the question is is there anyway to optimize your insert statement on your SQL Server database?

Alternatively... The question really becomes is the database timing out or is Appery's API express timing out?

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

Any suggestions from Appery.io in regards of shrinking an image base64 string prior to storing it in the database?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to store a image base64 from an image asset to sql server database field type CLOB?

Hello Bernie,

You are right, it might be a timeout issue. In that case you have to reduce a size of your image before send it to the server or improve the speed of your database server.

Return to “Issues”