Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16322
| Message-ID | <2610175.x4FWaXcEle@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2012-10-02 22:26 +0200 |
| Subject | Re: Sending email with attachments |
| Newsgroups | comp.lang.javascript |
| References | <JqadnXQNAdXTHffNnZ2dnUVZ_qSdnZ2d@earthlink.com> |
| Followup-To | comp.lang.javascript |
Followups directed to: comp.lang.javascript
Patricia Shanahan wrote: > I am writing a data collection application. It needs to run on as many > tablets and laptops as possible, so I'm writing it in HTML and > JavaScript. Although I cannot ask end users to buy a particular device, > I can ask them to install an up to date browser. > > The ultimate destination of the data is a spreadsheet on a workstation > controlled by the person doing the data entry, or one of their associates. > > The ideal, from my end users' point of view, would be a button they > could click that would send an e-mail to an address they enter with the > data attached in .csv format. You cannot do that client-side, so you will have to do it server-side. That is, have a server-side application compile the .csv and send the e-mail. Usually that would be the same server-side application that generated the client-side application in the first place. > I do understand that e-mail would not be the best way of getting the data > to a web server, but that is not the objective. Forwarding the data from > my web site to a user-specified e-mail address would require anti-spam > precautions, and be generally undesirable. If that is a concern, users of the application need to be authenticated before they can use that function (see also [OWASP]). Only shifting the load from the server to the client is not a solution. In fact, it has the potential to make matters worse. Client computers (including mobile devices) are usually much less protected, thus more easily compromised, than servers. > I've done web searches, and the closest I've been able to get is to fold > the data into a mailto URL as the message body, not an attachment. Technically, an e-mail attachment is a part of the message body of a multi- part message, following a delimiter line, own header and usually a Base64- encoded message-part body (see [RFC2046]); so, in theory, it could work. But I would not recommend it for production. In fact, security measures might prevent it. > I would be length limited by the Internet Explorer 2083 char URL limit, > and I think I would also have to quote URL special characters. Apparently there are exceptions for certain supported URI schemes, such as `data:'. [SO] There might be one for `mailto:' as well. However, a suitable MUA will need to be installed and configured at the client for this to work, which you should not make a requirement. > Another option is to just display the data and invite the user to > select and copy. The data could then be pasted into the body of an > e-mail, or into a text file in an editor window. I believe that would > work, but involves more end user busy work than is ideal. Yes, in a Web application you should make best use of the *Web* first. > I am very new to JavaScript, so I'm really hoping there is a better way > of doing this that I have just not found. Client-side there is nothing better than that, but it does not mean that it cannot be done using an ECMAScript implementation server-side. HTH PointedEars ___________ [OWASP] The Open Web Application Security Project: Authentication Cheet Sheet. (updated: 2012-09-28) <https://www.owasp.org/index.php/Authentication_Cheat_Sheet> [RFC2046] Freed, N., Borenstein, N.: Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types. November 1996. <http://tools.ietf.org/html/rfc2046> [SO] StackOverflow: What is the maximum length of a URL? (updated: 2012-07-12) <http://stackoverflow.com/a/417184/855543> -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-01 22:49 -0700
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 04:20 -0700
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 05:16 -0700
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 07:10 -0700
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 10:57 -0700
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 07:03 -0700
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 10:50 -0700
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 11:16 -0700
Re: Sending email with attachments dann90038@gmail.com - 2012-10-02 12:15 -0700
Re: Sending email with attachments "Tom de Neef" <tdeneef@qolor.nl> - 2012-10-02 21:28 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 12:59 -0700
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-02 22:26 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-03 20:04 +0100
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-06 02:07 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-06 08:48 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-06 20:29 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-06 21:49 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-07 08:13 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 14:28 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 00:43 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 03:26 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 07:18 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 11:13 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 18:57 +0100
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 09:46 +0100
Re: Sending email with attachments Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-10-08 12:01 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 19:16 +0100
Re: Sending email with attachments Gene Wirchenko <genew@ocis.net> - 2012-10-08 09:28 -0700
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 18:34 +0100
Re: Sending email with attachments Stefan Weiss <krewecherl@gmail.com> - 2012-10-07 12:46 +0200
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 18:55 +0200
Re: Sending email with attachments Stefan Weiss <krewecherl@gmail.com> - 2012-10-07 20:06 +0200
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 22:12 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-07 19:54 +0100
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 01:09 +0100
Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 13:10 +0200
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 19:20 +0100
OT: Mac vs PC for development (Was: Sending email with attachments) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-08 08:38 -0700
Re: Sending email with attachments Dr J R Stockton <reply1240@merlyn.demon.co.uk.invalid> - 2012-10-03 19:49 +0100
Re: Sending email with attachments Eli the Bearded <*@eli.users.panix.com> - 2012-10-03 23:08 +0000
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-04 02:46 +0100
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 19:42 -0700
Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-04 02:43 +0100
Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 19:54 -0700
csiph-web