katzer / cordova-plugin-email-composer

Edit and send email messages
Apache License 2.0
344 stars 334 forks source link

android base64 attachment: file not found #27

Closed mgerlach-klick closed 10 years ago

mgerlach-klick commented 10 years ago

Testing on Android 4.1.1, plugin version 0.8.1dev:

Trying to send a base64 encoded file as attachment fails with the error message: W/Gmail ( 2557): Failed to attach content://de.appplant.cordova.plugin.emailcomposer.attachmentprovider/blubb.zip due to a FileNotFoundException. Since the cached file has already been tried, this file cannotbe attached. Notify the user.

Here is a relevant code snippet:

        var zip = new JSZip();
        zip.file("Hello.txt", "Hello World\n");
        var content = zip.generate();
        var b = 'base64:blubb.zip//'+content;
        console.log(a);

        var subject = "subject";
        window.plugin.email.open({
            to          : toEmail || [],
            cc          : [],
            bcc         : [],
            subject     : subject,
            body        : mailContent,
            attachments : [b],
            isHtml      : true
        });

I can't currently spend too much time on this and my android is not very good, but is it possible that in EmailComposer.java you are not respecting the '/email_composer/' directory that you created when building the return Uri of the getUriForBase64Content method or something like that?

katzer commented 10 years ago

Servus,

you're right. I have fixed it.

mgerlach-klick commented 10 years ago

Gude! Thank you so much, you are awesome! Hey, do you have an amazon wishlist or something like that?

mgerlach-klick commented 10 years ago

Hey man, I just got back to this and FYI it's still not working :(