Home > Backend Development > PHP Tutorial > How to solve the error response when uploading Qiniu pictures on iOS?

How to solve the error response when uploading Qiniu pictures on iOS?

不言
Release: 2023-03-01 08:56:01
Original
1655 people have browsed it


Qiniu uploaded pictures until 0.95 and reported an error. Error message:

1

2

<QNResponseInfo= id: 045DDA6D-EF09-40B2-99D5-DCAA62330C3C, ver: 7.1.0, status: 400, requestId: NwkAAE39Vn76IH8U, NwkAAE39Vn76IH8U, xlog: body:3;UP:3/400;UP:28/400, xvia: 1.1 fwt16:2 (Cdn Cache Server V2.0), host: upload.qiniu.com ip: 60.10.3.48 duration: 8.792564 s time: 1476935464 error: Error Domain=qiniu.com Code=400 "(null)" UserInfo={error=incorrect zone, please use up-z1.qiniu.com}>

QNresp========(null)

Copy after login
Copy after login

Code:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

-(void)requestQNWithdata:(NSData *)data{

     

    AFManagerHelp *manager = [[AFManagerHelp alloc]init];

     

    [manager POST:uploadNOToken Splice:nil parameters:nil success:^(id responseObject) {

         

        NSString *upToken = [responseObject objectForKey:@"uptoken"];

        NSLog(@"token::===== %@",upToken);

        [self uploadPictureToQiNiu:data withToken:upToken];

         

    } failure:^(NSError *error) {

        NSLog(@"QNerror==%@",error.userInfo);

    }];

}

 

 

//上传七牛

-(void)uploadPictureToQiNiu:(NSData *)data withToken:(NSString *)token{

     

    QNUploadManager *upManager = [[QNUploadManager alloc]init];

 

    QNUploadOption * uploadOption= [[QNUploadOption alloc] initWithMime:nil progressHandler:^(NSString *key, float percent) {

         

        NSLog(@"QNpercent == %.2f",percent);

         

    } params:nil checkCrc:NO cancellationSignal:nil];

 

     

    [upManager putData:data key:nil token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {

         

        NSLog(@"QNinfo ===== %@\nQNresp========%@",info,resp);

         

    } option:uploadOption];

}

Copy after login
Copy after login

Are my method written wrong or is it a token problem?

Reply content:

Qiniu uploaded pictures until 0.95 and reported an error. Error message:

1

2

<QNResponseInfo= id: 045DDA6D-EF09-40B2-99D5-DCAA62330C3C, ver: 7.1.0, status: 400, requestId: NwkAAE39Vn76IH8U, NwkAAE39Vn76IH8U, xlog: body:3;UP:3/400;UP:28/400, xvia: 1.1 fwt16:2 (Cdn Cache Server V2.0), host: upload.qiniu.com ip: 60.10.3.48 duration: 8.792564 s time: 1476935464 error: Error Domain=qiniu.com Code=400 "(null)" UserInfo={error=incorrect zone, please use up-z1.qiniu.com}>

QNresp========(null)

Copy after login
Copy after login

Code:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

-(void)requestQNWithdata:(NSData *)data{

     

    AFManagerHelp *manager = [[AFManagerHelp alloc]init];

     

    [manager POST:uploadNOToken Splice:nil parameters:nil success:^(id responseObject) {

         

        NSString *upToken = [responseObject objectForKey:@"uptoken"];

        NSLog(@"token::===== %@",upToken);

        [self uploadPictureToQiNiu:data withToken:upToken];

         

    } failure:^(NSError *error) {

        NSLog(@"QNerror==%@",error.userInfo);

    }];

}

 

 

//上传七牛

-(void)uploadPictureToQiNiu:(NSData *)data withToken:(NSString *)token{

     

    QNUploadManager *upManager = [[QNUploadManager alloc]init];

 

    QNUploadOption * uploadOption= [[QNUploadOption alloc] initWithMime:nil progressHandler:^(NSString *key, float percent) {

         

        NSLog(@"QNpercent == %.2f",percent);

         

    } params:nil checkCrc:NO cancellationSignal:nil];

 

     

    [upManager putData:data key:nil token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {

         

        NSLog(@"QNinfo ===== %@\nQNresp========%@",info,resp);

         

    } option:uploadOption];

}

Copy after login
Copy after login

Are my method written wrong or is it a token problem?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template