在iPhone应用程序中自动上传相机胶卷?

我正在努力find一些有用的自动上传照片库中的照片到我的服务器端。 在我的iPhone应用程序,我想自动上传照片到服务器,因为用户捕捉到一张新照片。 Facebook,Dropbox和谷歌加应用程序的做法。

任何帮助。

大部分这是一个三步过程:

1)获取照片。 将其存储到文档目录 。 苹果在这里描述得非常好: PhotoPicker

2)文档目录中获取照片:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"Images"]; UIImage *image = [[UIImage alloc] initWithContentsOfFile:[dataPath stringByAppendingPathComponent:[NSString stringWithFormat:@"yourImage.png"]]]; 

3)现在,您可以将照片上传到服务器。 这个过程很好描述在这里: 从iPhone上传图像到服务器文件夹