Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

I have set up an upload service on my page.l have passed on a session token and all header requirements .however i keep getting error 400.Bad request cannot consume content type.i have read threads of over a year ago . replies indicated that it was a bug. Could it be that it has not been fixed up to now? Attached is a photo Image

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

Bad Request: Upload Service

Hello -

Could you please describe what exactly you have implemented in your app.

Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

i have one page, someone is supposed to login ,on that same page someone is supposed to attach a photo then click the upload button.in a nutshell that is what the app does. The login is successful and am able to store that session token in a variable of type string .AM also able to capture the photo and display it on the page,what i can't do is to take it from local storage to the database

The upload service is asking for 2 parameters, a session token and data. I pass on the token i have stored on the page after login then also pass on the data returned by the camera service stored in the im variable also on the same page. when i click the upload button am returned with the above error.The first screenshot i posted when thoroughly examined the session token is not passed on but i fixed that and still the same error is returned.Bad Request

if i can't get a fix for this, kindly walk me through uploading a photo taken by camera to the database,i have looked through all the documentation and tutorials everything seems right ..Am working with ionic and angularJS

Image

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

Bad Request: Upload Service

Hello,

Please clarify, what value does im variable have? Also, please provide us request data from the network tab.

Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

Thanks Sergiy for the reply.
The im has the File_URI just like the first screenshot i attached

"data":file///storage/emulated/0/Pictures/IMG_1121222_.jpg

i changed the camera service to return FILE_URI instead of DATA_URL (Base64)

Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

Am working with ionic&AnjularJS where there is no upload plugin.

Someone Please walk me through uploading a photo taken by camera and stored as base64. i can take the photo with the camera and display it on the page but i cant upload it.
i have created two variables Token of type string that stores the sessionToken after logging in and Im that stores the base64 returned by the camera and i pass them to the upload service as shown in the screenshot below but i keep getting Bad Request someone please guide me

Image

The application should look like this

Image

But when i click upload button on phone this is the error response i get on function (error)
Image

If i did not explain this well ,all i want to do is upload a photo i have taken with the camera to the database,In ionic there is no upload plugin to use like in bootsrap

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

Bad Request: Upload Service

Answered by email

Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

Hello Sergiy Kulibaba;
The email requested for a step by step instruction that i don't really get, i have laid out my problem here. kindly read through.

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

Bad Request: Upload Service

Hi Mwesigwa -

We don't have such ready to use example yet, but we are currently working on it.

Hopefully very soon we will publish it for a public use.

Mwesigwa Ezra
Posts: 0
Joined: Fri Mar 27, 2015 7:05 am

Bad Request: Upload Service

So currently isn't there a way to upload a photo in inonic?

Return to “Issues”