Page 1 of 1

Attaching image to email on Android

Posted: Mon Jun 06, 2016 2:50 pm
by Sevak Ajemyan
Hi there,

I am using mergPopActivity external to attach an image to an email or share it via social sites. This works correctly and opens the email application, but I get an error "Permission denied for the attachment" when sending the email.

Can you please review the code and let me know if there is any solution to this ?

Code: Select all

 try
      put "" into tText
      put "" into tUrl
      export the last image of card "sendpostcard" to url ("binfile:"&specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
      put specialFolderPath("documents")&"/postcardimage.jpg" into tImage

      mergPopActivity tText,tImage,tUrl
      
      answer the result
      
      --answer it 
   catch e
      --answer e
   end try
Thanks in advance,

Sevak

Re: Attaching image to email on Android

Posted: Mon Jun 06, 2016 3:10 pm
by Klaus
Hi Sevak,

1. welcome to the forum! :D

2. Please try again with the correct "export snapshot" syntax!
...
## export the last image of card "sendpostcard" to url ("binfile:"&specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
export last image of card "sendpostcard" to FILE (specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
...

If in doubt, ALWAYS take a look into the dictionary!


Best

Klaus

Re: Attaching image to email on Android

Posted: Mon Jun 06, 2016 4:01 pm
by Sevak Ajemyan
Hi Klaus,

Thank you for qick response. The problem isn't with exporting the image, it works both in the code you provided and the one I posted. The two codes easily export the image into a folder but the problem is that the image isn't possible to send via email. It still shows the error.

The same code works great on IOS with mergeIOS.lcext external, problem occurs only on Android with mergAndroid.lcext external.

Re: Attaching image to email on Android

Posted: Mon Jun 06, 2016 4:47 pm
by Klaus
Aha, OK, maybe a bug in the Android external?
Sorry, I do not develop for mobile...