'400' [HTTP 400] <bad request>

Hi, I am trying to upload this image to the server, but for some reason I always end up in the fault with this error:

'400' [HTTP 400] &lt;bad request&gt;

Here is the function:

func upload(image: UIImage){
        let path = "cards/\(AppDelegate.md5(string: backendless.userService.currentUser.getProperty("objectId") as! String))/\(currentTimeMillis()).png"
        NSLog("path = \(path)")
        let data:NSData = UIImagePNGRepresentation(image)!
        backendless.fileService.upload(path, content: data, overwrite: false, response: { (uploadedFile: BackendlessFile!) in
        }) { (fault: Fault!) in
            NSLog("FILE_UPLOAD_ERROR: \(fault)")

XCode Log:

2016-05-31 23:44:36.660 Cards[7323:4128744] path = cards/adf6aa61a6563856b6377f0d3a24c4e9/1464727476660.png
2016-05-31 23:44:46.154 Cards[7323:4128744] FILE_UPLOAD_ERROR: FAULT = '400' [HTTP 400] &lt;bad request&gt; 

Ok it appears the problem had something to do with the Business logic, I disabled the file handlers and it seems to work just fine, however same cloud code does not return an error for Android devices.

Alright so I thought my custom server side logic was causing the issue but that wasn’t the case. Even when I had the default code generated empty logic it would still return a 400 bad request error.

I believe this is an issue with the iOS SDK and the way it interacts with the cloud code, because this had never occurred to me while interacting with event handlers on Android.

please provide your application id and more concrete steps to reproduce this issue.

Application ID:


File Handler:

Please try FlieService ‘saveFile’ method instead ‘upload’.