attaching a csv file to an email
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
attaching a csv file to an email
I am using 6.6.1 - trying to send a csv file as an email attachment from Android but without success
using:
put specialFolderPath("documents") into tFilePath
put tFilepath into tAttachment["file]"
put "test.csv" into tAttachments["name"]
put "text/plain[or csv]" into tAttachments["type"]
mobileCompose[or Unicode]Mail "subject..", tAddress,,,tBody, tAttachment
Any suggestions.
using:
put specialFolderPath("documents") into tFilePath
put tFilepath into tAttachment["file]"
put "test.csv" into tAttachments["name"]
put "text/plain[or csv]" into tAttachments["type"]
mobileCompose[or Unicode]Mail "subject..", tAddress,,,tBody, tAttachment
Any suggestions.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Hi newtronsols,
You are putting a path to the file in not the file:
And Android attachments currently only work with gMail.
Simon
You are putting a path to the file in not the file:
Code: Select all
put url("file:" &specialFolderPath("documents") & "/test.csv") into tFile
put tFile into tAttachment["data"]
put "text/csv" into tAttachment["type"]
put "test.csv" into tAttachment["name"]
mobileComposeMail "File Example", "you@youMailHost.com",,,, tAttachment
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: attaching a csv file to an email
Thanks I'll give that a try. Is there a way to make Livecode use Gmail - or does it need to be set as the default email account?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Hi newtronsols,
Apparently I'm mistaken;
I think the default email client has to be set in the device by the user not via liveCode.
Simon
Apparently I'm mistaken;
should work, it is reported as a bug at the moment.put specialFolderPath("documents") into tFilePath
put tFilepath into tAttachment["file]"
I think the default email client has to be set in the device by the user not via liveCode.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 9850
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: attaching a csv file to an email
Is the goal to allow the user to send an email with this data to anyone they want, or to get that data to a specific recipient?
And must the data be specifically CSV?
And must the data be specifically CSV?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Rats didn't read what I was posting.
This is what should work but is broken
the actual file is [data]
Simon
This is what should work but is broken
So file path is [file]put specialFolderPath("documents") & "/test.csv" into tFilePath
put tFilePath into tAttachment["file"]
the actual file is [data]
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: attaching a csv file to an email
Yes the idea is they can send it to anyone or themselves. I was hoping to be able to use any email system - I'm not sure what percentage of Android users use Gmail.FourthWorld wrote:Is the goal to allow the user to send an email with this data to anyone they want, or to get that data to a specific recipient?
And must the data be specifically CSV?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Hi newtronsols,
Could you post your device information here
http://quality.runrev.com/show_bug.cgi?id=11895
This is very hot now, it's currently right in front of them.
Simon
Could you post your device information here
http://quality.runrev.com/show_bug.cgi?id=11895
This is very hot now, it's currently right in front of them.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: attaching a csv file to an email
Thanks,
Just reading:
put tFilename into tAttachment["file"]
or
put url("binfile:" & tFilename) into tAttachment["data"]
I will need to test these tomorrow.
Just reading:
put tFilename into tAttachment["file"]
or
put url("binfile:" & tFilename) into tAttachment["data"]
I will need to test these tomorrow.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Hi newtronsols,
I've never actually tested
put url("binfile:" & tFilename) into tAttachment["data"]
It does read correctly but this is the way I currently doing it
put url("file:" &specialFolderPath("documents") & "/test.csv") into tFile
put tFile into tAttachment["data"]
Simon
I've never actually tested
put url("binfile:" & tFilename) into tAttachment["data"]
It does read correctly but this is the way I currently doing it
put url("file:" &specialFolderPath("documents") & "/test.csv") into tFile
put tFile into tAttachment["data"]
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: attaching a csv file to an email
I have tested :
put "email body text" into tBody
put "text/csv" into tAttachment["type"]
put "test.csv" into tAttachment["name"]
put url(specialFolderPath("documents") & "/test.csv") into tFile
#then either put tFile into tAttachment["data"] or
put url("file:" & tFile) into tAttachment["data"]
mobileComposeMail "Subject", tAddress,,,tBody, tAttachment
But still no attachment. Note not testing with gmail. I also tested using 'binfile' - just in case.
put "email body text" into tBody
put "text/csv" into tAttachment["type"]
put "test.csv" into tAttachment["name"]
put url(specialFolderPath("documents") & "/test.csv") into tFile
#then either put tFile into tAttachment["data"] or
put url("file:" & tFile) into tAttachment["data"]
mobileComposeMail "Subject", tAddress,,,tBody, tAttachment
But still no attachment. Note not testing with gmail. I also tested using 'binfile' - just in case.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
Hi newtronsols,
I've only heard of one person getting attachments to work on Android without using gMail and he's at RunRev. No one else has reported it working, it is still an open bug.
Android gMail - works
Android Email - doesn't work (for me and a few others).
Simon
Edit: Please add your information to the bug report found at the link above.
I've only heard of one person getting attachments to work on Android without using gMail and he's at RunRev. No one else has reported it working, it is still an open bug.
Android gMail - works
Android Email - doesn't work (for me and a few others).
Simon
Edit: Please add your information to the bug report found at the link above.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: attaching a csv file to an email
This now works in 6.6.2 rc4 or 5.
see http://quality.runrev.com/show_bug.cgi?id=11895#c32
My other questions:
...the attachment shows an android robot icon next to the test.csv attachment file name - can we personalise this attachment icon?
Also I have noticed if I build a different version of the same app (simply changing the label & identifier) - data previously saved in the 'documents' folder is not retrieved. I haven't tested updating an app in Google Play - to see if it retrieves previously stored phone data in the app's documents folder.
So are these document specialfolderpaths 'relative' to the built version (label) of the app - and not absolute document folder locations shared by all apps?
I was thinking if I had a paid version and a free version of an app I would want to be able to re-use the data stored from the free version in the paid version which would have its own label/identifier.
Is it possible to specify a specialfolderpath that allows data to be accessible by any app?
see http://quality.runrev.com/show_bug.cgi?id=11895#c32
My other questions:
...the attachment shows an android robot icon next to the test.csv attachment file name - can we personalise this attachment icon?
Also I have noticed if I build a different version of the same app (simply changing the label & identifier) - data previously saved in the 'documents' folder is not retrieved. I haven't tested updating an app in Google Play - to see if it retrieves previously stored phone data in the app's documents folder.
So are these document specialfolderpaths 'relative' to the built version (label) of the app - and not absolute document folder locations shared by all apps?
I was thinking if I had a paid version and a free version of an app I would want to be able to re-use the data stored from the free version in the paid version which would have its own label/identifier.
Is it possible to specify a specialfolderpath that allows data to be accessible by any app?
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: attaching a csv file to an email
The documents folder is a virtualized folder available only to your app. This is true of most (or all?) Android apps, due to sandboxing. Malware would love to have access to every document on your device.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: attaching a csv file to an email
My guess is that is the default because the device has not file type association. Bet if you changed the extension to .xls an Excel icon would be there. Actually in your case probably not because Excel would pick up the csv....the attachment shows an android robot icon next to the test.csv attachment file name
Not that I know of, except to build another app that associates csv with itself.can we personalise this attachment icon?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!