I want to upload an image generated by my app to Dropbox. I see the upload method from DBRestClient, but it seems to me that I have to write the Image to a temp file before calling the upload method.
Is there any way to upload file from an object in memory? Something like this:
UIimage *myImage = [[UIImage alloc]....
//
// Here I create the image on my app
//
NSData *myData = UIImageJPEGRepresentation(myImage, 1.0);
DBRestClient *rc = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient = rc;
[rc release];
self.restClient.delegate = self;
[self.restClient uploadFile:@"myImage.jpg" toPath:@"DropBoxPath" fromPath:myData];
The header of DBRestClient does only reveal
The iPhone has a disk, so upload your image as tmp file with the given method and delete it afterwards? You can use writeToFile:atomically: or writeToFile:options:error: of NSData for that purpose.