i am working on an app based on job portal, now i am stuck with document upload, i need to look for documents on device on button click, and attach document on selection.I have to upload selected document to server. how can i do this ? any way out ?
Asked
Active
Viewed 702 times
0
-
1use https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html – Vinodh Oct 27 '16 at 06:55
-
@Vinodh how can i use it on button click ? :/ – Shikha Sharma Oct 27 '16 at 06:56
-
@Vinodh is it for phone documents ? – Shikha Sharma Oct 27 '16 at 06:57
-
1Yes please use following link http://stackoverflow.com/a/33733557/1142743 – Vinodh Oct 27 '16 at 06:58
-
@Vinodh Thanks a lot :) – Shikha Sharma Oct 27 '16 at 06:58
1 Answers
1
I found solution for my query.Below is the code.
- (IBAction)search:(id)sender {
UIDocumentMenuViewController *importMenu =
[[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.data"]
inMode:UIDocumentPickerModeImport];
importMenu.delegate = self;
[self presentViewController:importMenu animated:YES completion:nil];
[importMenu addOptionWithTitle:@"Photos" image:nil order:UIDocumentMenuOrderFirst handler:^{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
[self presentViewController:imagePickerController animated:YES completion:nil];
}];
}
-(void)documentMenu:(UIDocumentMenuViewController *)documentMenu didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
{
documentPicker.delegate = self;
[self presentViewController:documentPicker animated:YES completion:nil];
}

Shikha Sharma
- 451
- 1
- 5
- 25