Email .JPG image on Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Email .JPG image on Android

Post by trags3 » Mon May 26, 2014 5:43 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Email .JPG image on Android

Post by Klaus » Tue May 27, 2014 5:31 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Email .JPG image on Android

Post by Simon » Tue May 27, 2014 7:37 pm

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.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

viro
Posts: 52
Joined: Fri Jul 05, 2013 6:59 pm

Re: Email .JPG image on Android

Post by viro » Wed May 28, 2014 9:32 am

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
the funniest thing about this particular signature is that by the time you realize it doesn't say anything it's too late to stop reading it

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Email .JPG image on Android

Post by Simon » Wed May 28, 2014 9:55 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Re: Email .JPG image on Android

Post by trags3 » Thu May 29, 2014 2:03 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Email .JPG image on Android

Post by Simon » Fri May 30, 2014 7:39 am

Hi Tom,
The report says 6.6.2 RC 4 has the fix.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply