Sankar MCTS
Posts: 0
Joined: Tue Oct 28, 2014 8:28 am

"Cannot consume content type" error since upgrade

Hi. I use latest new appery.io builder.

Sankar MCTS
Posts: 0
Joined: Tue Oct 28, 2014 8:28 am

"Cannot consume content type" error since upgrade

here it seems dead

Sankar MCTS
Posts: 0
Joined: Tue Oct 28, 2014 8:28 am

"Cannot consume content type" error since upgrade

please help us. we are planning to move to production. because of upload failure we are waiting

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

"Cannot consume content type" error since upgrade

Hello!

We are working on it.
I will let you know when have more information from developers team.

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

"Cannot consume content type" error since upgrade

Hello!

1) Create generic service with the following implementation

pre
Apperyio.my = Apperyio.createClass(null, {

init : function(requestOptions) {
this.__requestOptions = $.extend({}, requestOptions);
},

process : function(settings) {
settings.beforeSend(settings);

Code: Select all

 if (this.__requestOptions.echo) { 
     settings.success(this.__requestOptions.echo); 
 } else { 

var uploadMyFiles = function (inputComponents){
var fd = new FormData();
$(inputComponents).each(function(){
var files = this.files;
$(files).each(function(){
fd.append( this.name, this );
});
});
return fd;
};
$.ajax({
headers: {
"X-Appery-Database-Id":settings.data.dbId,
"X-Appery-Session-Token":settings.data.token
},
url: 'https://api.appery.io/rest/1/db/files',
type: 'POST',
data: uploadMyFiles(Apperyio(settings.data.fileInput)),
processData: false,
contentType: false,
success: function ( data ) {
settings.success(data);
}
});

Code: Select all

 } 
 settings.complete('success'); 

}
});/pre

Note - in first line replace "my" with your file name

2) For this service add the following request parameters http://gyazo.com/cb79fb44c4e03cee5f55...

3) Add service on page where you upload file and add the following mapping http://gyazo.com/6b14d691433bba0aca62...

where
token - DB token
dbId - DB id
fileInput - input component name, with type=file

4) Invoke service as usually.

Sankar MCTS
Posts: 0
Joined: Tue Oct 28, 2014 8:28 am

"Cannot consume content type" error since upgrade

I tried with your approach for fixing this issue in my end.

But I get : "This data source not be supported in the method of upload multiple files".

Note :
In the localStorage I've created token, dbId, fileInput variables
.
I assigned the following in page load event of login page.

localStorage.setItem("dbId",currentDB_settings.database_id);
localStorage.setItem("fileInput","file_input"); // I am not sure about "fileInput" variable - what I can pass here?

Please help me to resolve this issue.
Image

Thanks,
Sankara

Sankar MCTS
Posts: 0
Joined: Tue Oct 28, 2014 8:28 am

"Cannot consume content type" error since upgrade

Here is the public url for my app.

http://appery.io/app/view/72d15ff4-57...

credentials to login
user name : power
password : power

uploading page will display

Start Firebug Console in Firefox

Browse and select an image in your local system

click Upload button :

you will get : This data source not be supported in the method of upload multiple files

Please help me

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

"Cannot consume content type" error since upgrade

Hello!

Could you try this way offered by Yurii https://getsatisfaction.com/apperyio/...?

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

"Cannot consume content type" error since upgrade

Hi There, got the same error msg when querying for users' data.
that helped me.
had to set

contentType: false,

Thks
Eric

Return to “Issues”