-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong attachment path #14
Comments
I think the issue is the path. Its a path on your Mac and not of your Phone. |
Hi, katzer and thanks for your response. The path "file:///var/mobile/Applications/......../tmp/cdv_photo_001.jpg" is the URI path of my iphone. I tried to cut path like "var/mobile...........jpg" but doesn't work. I don't know what path pass to plugin. Do you have any example of this? Thanks and regards. |
+1 |
Servus, you have to use the absolute path. For example "/Users/sebastian/Library/Application Support/iPhone Simulator/7.0.3/Applications/E7981856-801F-4355-8687-EAACDF8B2A54/HelloCordova.app/../Documents/image.jpg" But thats not very handy. I want to change that with the next release. For iOS you can replace the method - (void) setAttachments:(NSArray*)attatchments ofDraft:(MFMailComposeViewController*)draft
{
if (attatchments)
{
NSString* bundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/"];
for (NSString* path in attatchments)
{
NSString* fullPath = [bundlePath stringByAppendingString:path];
NSData* data = [[NSFileManager defaultManager] contentsAtPath:fullPath];
NSString* pathExt = [path pathExtension];
NSString* fileName = [path pathComponents].lastObject;
NSString* mimeType = [self getMimeTypeFromFileExtension:pathExt];
[draft addAttachmentData:data mimeType:mimeType fileName:fileName];
}
}
} Then you can specify your attachments with an relative path. attachments: ['../tmp/cdv_photo_001.jpg'] |
Hi.
I'm testing this pugin with Phonegap Build.
All works fine but I can't attach an image.
I'm using the camera to capture image and send email composer the URI of image.
The path is like: file:///var/mobile/Applications/......../tmp/cdv_photo_001.jpg
I tried to slice the firsts character but doesn't work.
How can I attach image to email?
Thanks.
The text was updated successfully, but these errors were encountered: