Start a new topic

Error downloading file

When I'm trying to download a file, I got this error:



Error Domain=KCSResourceErrorDomain Code=400 "Error downloading file, id='6c0393c0-607a-42a0-9ce0-2cd1c2cd3650'" UserInfo=0x15ef4370 {NSUnderlyingError=0x15e2e950 "The operation couldn’t be completed. (KCSAppDataErrorDomain error 400.)", NSLocalizedDescription=Error downloading file, id='6c0393c0-607a-42a0-9ce0-2cd1c2cd3650'}



This is my code where I try to download the file:



[KCSFileStore downloadData:@"5e79fa00-b7b1-47e9-9f61-70e8087acba2" completionBlock:^(NSArray *downloadedResources, NSError *error) {

if (error == nil) {

KCSFile* file = downloadedResources[0];

NSData* fileData = file.data;

update.attachment = [UIImage imageWithData:fileData];

} else {

NSLog(@"Got an error: %@", error);

}

} progressBlock:nil];



Any idea what might be causing this error?

What version of KinveyKit are you using?

Were you able to resolve this? I am currently getting the same error.



Michael, I just moved to 1.25.0 and this created this error. Any thoughts?
Unfortunately, there isn't enough info here to debug. It looks like there is an underlying error object, can this be followed through to a more descriptive error? If not, the ouput of debug logs might be useful: http://devcenter.kinvey.com/ios/guides/troubleshooting
I am using KinveyKit 1.25.0
There is nothing in the debug logs that looks alarming or revealing. Here is the error message:



Error Domain=KCSResourceErrorDomain Code=400 "Error downloading file, id='0d283bb7-5a93-4a72-ab73-0fd18eb9f4bb'" UserInfo=0xc0c9300 {NSUnderlyingError=0xc0c3cf0 "The operation couldn’t be completed. (KCSAppDataErrorDomain error 400.)", NSLocalizedDescription=Error downloading file, id='0d283bb7-5a93-4a72-ab73-0fd18eb9f4bb'}



I am correctly using the downloadData method as defined in the API documentation. I am not using data protection through Kinvey. As mentioned this error was raised only once I moved to KinveyKit 1.25.0. Any other ways I could be messing the request up?
@Will,



Having the logs would be helpful, especially the x-kinvey-request-id and the headers to see if there is something the sdk might be mishandling. You can email them to me at michael@kinvey.com if you don't want to post them here. If there is an underlying error object in that error object, you might be able to go down the chain to get the the actual error that is causing the problem, if available. That information would be helpful as well.
There is a bug in KinveyKit 1.25. I am currently working on the fix.
Hi Giovanni,

The 1.26 release is out. http://devcenter.kinvey.com/ios/downloads
Login or Signup to post a comment