Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

Hello! If you upload to File in DB the this post should help https://getsatisfaction.com/apperyio/.... You don't need to resize image. When you upload file to DB it changes it's name (there some symbols added in the beginning to make it unique). That's why on upload file service Success event you have to save to DB retrieved in response real file name https://getsatisfaction.com/apperyio/... - this way you'll have real file name. After you get it in service (you use to get data from DB collection) response you can form path to the file (to add in app link to download file or show image) - http://docs.appery.io/documentation/b...

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

Camera to Database.

If I use the imageDataBase64 value (stored in a local variable) as one of the request fields to my web service (either in the header or not), the web service errors (regardless of the action of the web service).

If I exclude the variable value as an input to the web service, it works. I need to pass the data in the local variable (which is an imageDataBase64 value) to my server, but it fails every time it's included.

Can I not include the imageDataBase64 value as an input/request field on my web service?

Any help would be appreciated.

Thanks!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Camera to Database.

Hello Steve!

What errors do you get? Send us screen shots.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

Camera to Database.

The call to the web service fails (if I include the imagedatabase64 variable as input), there are no error messages. Although I did set up a javascript alert that is triggered on a service error event. This alert fires if I include the variable as input and the service succeeds if I don't.

I tried to use an image asset as input to the web service and it works fine. But if I invoke the camera service and map the imagedatabase64 output of the camera service to update the image asset value, then the service fails.

No matter what I've tried, the output of the camera service (imagedatabase64 value) always causes the web service to fail/error when it's mapped as an input to the service. I've even used another backend server to determine if a server setting may be causing the issue, but it fails on every server I've tried.

I need the phone's camera to get the input in order to test this. Therefore I'm using the Appery Android tester app. I can't see any way to get a console output when using the tester app. If I try to use the web based tester, the camera function doesn't work when called.

Any suggestions are greatly appreciated.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

Camera to Database.

After some more digging, I decided to try setting the image output to a tiny value (4 px X 6px) and it worked!

I found the limit was around 200px X 300px before the web service would fail again. So it must be a limit on my server's end to not accept requests over a certain size? Now I know where to dig deeper!

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

Camera to Database.

I found the problem was related to the max size of the header request to our servers. The default max request size for Apache servers is 8k. Which means only tiny photos can be uploaded with this common default setting.

Since you have to map the photo data to the request side of the web service, it appears that the only way around this is to increase your Apache settings? Is there any other way to resolve this issue?

By the way, here's some more info on the Apache max header size for anyone else having this issue...

http://www.linuxjunkies.org/adminstra...

It shows the default size of header request on Apache is 8k.

Here's some more info:

http://httpd.apache.org/docs/current/...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

Hi, why do you send image in header? Why don't you send it in body of POST request? See http://httpd.apache.org/docs/current/...

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

Camera to Database.

Uggh. Brain fart. I had tried it earlier as part of a GET and it failed too, but I never tried the POST. Works great!

Grace Yip
Posts: 0
Joined: Wed Sep 11, 2013 7:47 pm

Camera to Database.

hi,

i followed all to steps and now i want to data map it to the local storage but i then get the photo_buffer ...

can some please help me

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Camera to Database.

Hi -- Please can you clarify what exactly is not working?

Return to “Issues”