I am saving files(Images - Videos) via cloud code. First I convert file to base64 string and send the string to cloud code as a parameter.
Images works fine but when video string is large, cloud code goes insane. Cloud code never fire answer callback. I mean there is no error or success in android client. And cloud code runs the same code over and over. eventually uploads same video few times until I stop client (android) app.
I see successful message on console log. And beforeSave and afterSave triggers runs fine. But Client app doesnt get any result. Neither error or successful message.
This is my code:
HashMap<String, Object> params = new HashMap<>();
params.put("text", postdesc.getText().toString().trim());
params.put("media",base64);
params.put("thumbnail",base64Thumb);
ParseCloud.callFunctionInBackground("sharePostVideo", params, new FunctionCallback<Post>() {
@Override
public void done(Post post, ParseException e) {
if(!UploadActivity.this.isFinishing()&&!UploadActivity.this.isDestroyed()){
if(e==null){
progressDialog.dismiss();
Intent data = new Intent();
data.putExtra("post",post);
data.setData(Uri.parse(post.getObjectId()));
setResult(RESULT_OK, data);
Glide.with(linkimage).clear(linkimage);
Glide.with(secilenvideoimage).clear(secilenvideoimage);
Glide.with(secilenimageview).clear(secilenimageview);
finish();
}
else{
progressDialog.dismiss();
GenelUtil.ToastLong(getApplicationContext(),getString(R.string.error));
}
}
}
});
And Console gives me this error:
BadRequestError: request aborted
at IncomingMessage.onAborted (/root/parse/node_modules/body-parser/node_modules/raw-body/index.js:231:10)
at IncomingMessage.emit (events.js:310:20)
at IncomingMessage.EventEmitter.emit (domain.js:482:12)
at abortIncoming (_http_server.js:532:9)
at socketOnClose (_http_server.js:525:3)
at Socket.emit (events.js:322:22)
at Socket.EventEmitter.emit (domain.js:482:12)
at TCP.<anonymous> (net.js:672:12)
Then cloud codes runs again.
Do you have any Idea how to solve this?