OfficeDev / Office-365-SDK-for-iOS

Microsoft Services SDKs for iOS Preview produced by MS Open Tech.
https://dev.office.com/
Other
96 stars 49 forks source link

Upload new file - Return Error Domain=Error in the Request Code=400 "(null)" #99

Closed tranhieutt closed 8 years ago

tranhieutt commented 8 years ago

In last week, we can upload new file normally, but today, we can't upload new into Office 365.

When I debug code:

      MSSharePointFileFetcher *te = [[[[[self.client.files getById:self.documentId] asFolder] children] getById:_id] asFile];

      [te  putContent:body callback:^(NSInteger statusCode, MSOrcError *error) {
                        NSLog(@"%@",error);
                    }];

Error is:

Error Domain=Error in the Request Code=400 "(null)" UserInfo={error={
    code = InvalidArgument;
    message = "The argument is invalid, missing, or has an incorrect format";
}}

Please help me, why I don't change anything in our code, but now server return above error? How in the case server return about error??

tranhieutt commented 8 years ago

Sorry @anihojnadel , we need your help. please answer!!!

tranhieutt commented 8 years ago

Today, we can upload file successful, with code:

[[[[[[[self.client.files getById:self.documentId] asFolder] children] getById:_id] asFile] addCustomHeaderWithName:@"If-Match" value:@"*"] putContent:body callback:^(NSInteger statusCode, MSOrcError *uploadError) {

                        dispatch_async(dispatch_get_main_queue(),
                                       ^{
                                           //

                                       });
                    }];