Skip to content

Upload videos , images and other files(pdf, doc,..) using multiPart class objective C

License

Notifications You must be signed in to change notification settings

Datt1994/DPMultiPartObjC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

DPMultiPartObjC

Upload videos , images and other files(pdf, doc,..) using multiPart class objective C

For Swift :- DPMultiPartSwift

Step 1:- Copy & paste multiPart.h & multiPart.m files into your project

Step 2:- Usage

    #import "multiPart.h"

    NSString *imgPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"jpeg"];
    NSDictionary *dicParameetrs = @{
                                    @"a_id" : @"1",
                                    @"name" : @"datt"
                                    };
    NSArray *arrFiles = @[
                          @{ multiPartFieldName:@"images[]"/*(if only 1 file upload don't use [])*/ ,
                             multiPartPathURLs: @[imgPath ,
                                                  imgPath ,
                                                 @"file://xyz/....png"] },
                          @{ multiPartFieldName:@"video" ,
                             multiPartPathURLs:@[@"file://xyz/....mp4"] },
                          @{ multiPartFieldName : @"pdf[]" ,
                             multiPartPathURLs : @[@"file://xyz/....pdf" ,
                                                  @"file://xyz/....pdf"] }
                          ];
    
    [[multiPart sharedInstance] callPostWebService:@"www.xyz.com/../.."
                                        parameetrs:[[NSMutableDictionary alloc] initWithDictionary:dicParameetrs]
                                       filePathArr:arrFiles
                                        completion:^(NSDictionary *user, NSString *strErr, NSError *error) {
                                            if (!error) {
                                                NSLog(@"%@", user);
                                            }
                                        }];

Releases

No releases published

Packages

No packages published