Page 1 of 1

Email .JPG image on Android

Posted: Mon May 26, 2014 5:43 pm
by trags3
I am having difficulty emailing a .JPG file on Android with Gmail.
Here is my code
on mouseUp
export snapshot from rect "0,0,400,677" of this card to FILE (specialFolderPath("documents") & "/sellnet.jpg") as JPEG
put fld"sellemail" of card 2 into treciep
put specialFolderPath("documents") & "/sellnet.jpg" into tFile
put tFile into tAttachment["file"]
put "Check This Out" into tAttachment["name"]
put"image/jpg" into tAttachment["type"]
mobileComposeMail "Seller Est Net Sheet", treciep,,,"Please See the Attached Estimated Seller's Net Sheet", tAttachment
end mouseUp

The file gets sent ok as an attachment but the file type ".JPG" is dropped and I can't open the file without re naming it.
I have tried variations on the " put"image/jpg" into tAttachment["type"] " statement to no avail. Some platforms have no trouble with this but my android phone does.
Suggestions?

Thanks
Tom

Re: Email .JPG image on Android

Posted: Tue May 27, 2014 5:31 pm
by Klaus
Hi Tom,

maybe this applies to your problem:
http://forums.runrev.com/phpBB2/viewtop ... 53&t=20344 ?

And please do ALWAYS note the Livecode version your are using, thanks!

Will move this thread to the ANDROID forum.


Best

Klaus

Re: Email .JPG image on Android

Posted: Tue May 27, 2014 7:37 pm
by Simon
Hi Tom
"put"image/jpg" into tAttachment["type"] "
should be
"put image/jpeg into tAttachment["type"] "
Not sure if you meant to have the quotes around image/jpg but they shouldn't be there (as well as jpg should be jpeg).

That should solve it for you.

Simon
Edit: ooops... the quotes should be there.

Re: Email .JPG image on Android

Posted: Wed May 28, 2014 9:32 am
by viro

Code: Select all

on mouseUp
export snapshot from rect "0,0,400,677" of this card to FILE (specialFolderPath("documents") & "/sellnet.jpg") as JPEG
put fld"sellemail" of card 2 into treciep
put specialFolderPath("documents") & "/sellnet.jpg" into tFile
put tFile into tAttachment["file"]
put "Check This Out.jpg" into tAttachment["name"]
put"image/jpeg" into tAttachment["type"] 
mobileComposeMail "Seller Est Net Sheet", treciep,,,"Please See the Attached Estimated Seller's Net Sheet", tAttachment
end mouseUp
i think i already had this error too

Re: Email .JPG image on Android

Posted: Wed May 28, 2014 9:55 am
by Simon
hmmm..
What does this stack do for you?
"Updated stack using composeMail" found here:
http://quality.runrev.com/show_bug.cgi?id=11895
it has export in it.

Simon

Re: Email .JPG image on Android

Posted: Thu May 29, 2014 2:03 pm
by trags3
trags3 wrote:I am having difficulty emailing a .JPG file on Android with Gmail.
Here is my code
on mouseUp
export snapshot from rect "0,0,400,677" of this card to FILE (specialFolderPath("documents") & "/sellnet.jpg") as JPEG
put fld"sellemail" of card 2 into treciep
put specialFolderPath("documents") & "/sellnet.jpg" into tFile
put tFile into tAttachment["file"]
put "Check This Out" into tAttachment["name"]
put"image/jpg" into tAttachment["type"]
mobileComposeMail "Seller Est Net Sheet", treciep,,,"Please See the Attached Estimated Seller's Net Sheet", tAttachment
end mouseUp

The file gets sent ok as an attachment but the file type ".JPG" is dropped and I can't open the file without re naming it.
I have tried variations on the " put"image/jpg" into tAttachment["type"] " statement to no avail. Some platforms have no trouble with this but my android phone does.
Suggestions?

Thanks
Tom
I am using LC 6.6.2 rc 3
Gmail version 4.8 on a LG G2 phone Android version 4.4.2
The put "image/jpeg" form has the same error.
Thanks
Tom

Re: Email .JPG image on Android

Posted: Fri May 30, 2014 7:39 am
by Simon
Hi Tom,
The report says 6.6.2 RC 4 has the fix.

Simon