Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16461

Re: Sending email with attachments

Date 2012-10-08 07:18 +0100
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.lang.javascript
Subject Re: Sending email with attachments
References (5 earlier) <3592620.Gox2ZXX9UI@PointedEars.de> <WMmdnXmiOKk-tuzNnZ2dnUVZ_qidnZ2d@earthlink.com> <6035717.rH6HMBR8Db@PointedEars.de> <McudnUcZceMaju_NnZ2dnUVZ_vWdnZ2d@earthlink.com> <1876351.4oM7Z9lvqd@PointedEars.de>
Message-ID <ZKydnRadRqSm7e_NnZ2dnUVZ_qidnZ2d@earthlink.com> (permalink)

Show all headers | View raw


Thomas 'PointedEars' Lahn wrote:
> Patricia Shanahan wrote:
> 
>> […] Suppose a JS+HTML application were to exist that had tabular data in
>> JavaScript data structures, and needed to transfer it to a spreadsheet on
>> a workstation without using any special server set-up. What would be the
>> best ways to do it?
> 
> That depends.
> 
> In addition to the already discussed solutions, with client-side scripting 
> data can be collected and stored locally on the mobile device, with cookies 
> or DOM Storage (DOM Storage works best with file:// equivalents, non-trivial 
> data structures and larger amounts of data).  It can be transferred from 
> that storage to a common data base (not necessarily: database) or *perhaps* 
> (I have not tried that yet) accessed from the workstation directly, when 
> both the mobile device and the workstation are within the same network again 
> or are otherwise connected to each other (cloud storage comes to mind; I 
> have not tried that yet either, but as long as it supports HTTP access that 
> could be feasible).

I am certainly going to need storage for offline operation. In some
cases, the data collection will happen offline, but the transfer of the
data to the workstation will be done in a WiFi Internet environment.

DOM storage seemed to me to be far more practical for a data table than
cookies.

I want to minimize the risk of data loss in case of e.g. the browser
being closed, so I plan to write data to DOM storage as I go along,
rather than waiting to the end of the observing session.

I'm planning to use JSON to turn individual observation records
into strings for storage. I'm currently planning to use the string
version of an integer sequence number, concatenated with a session
identifier, as the storage key.

> I have updated my testcase to show how Local Storage works on mobile devices 
> both with http:// and file:// equivalents 
> <http://PointedEars.de/scripts/test/dom/mailto>

I'll read your code with interest. I think I understand DOM storage,
from reading about it, but a worked example is often helpful.

> 
> But a Thick Client Web application (in an HTML document in a Web browser) is 
> capable of displaying those spreadsheets and charts by itself, so 
> transferring the data might not be necessary in the first place.

The data from one device may have to be combined with data collected on
other devices, and will be analyzed and reorganized, before ending up
summarized in graphs and tables in a scientific paper.

I've seen my lead user's office. He has an iPad, but he also has a
Windows workstation, and when he wanted to email me some of the result
files for a project, he used the workstation.

> 
>> The simplest and most general solution I have thought of is to display
>> the data as CSV text, so that the user can select and copy it to the
>> clipboard. From there, they can do all sorts of things with it, subject
>> only to device limitations, including pasting it into the body of an
>> e-mail, or, pasting it into a text editor window and saving it, as a
>> .csv file, on a thumb drive.
> 
> That is another option.  You can also generate and process JSON or XML, with 
> the additional advantage of transferring more structured information.

It does have to be a format that spreadsheet programs, especially Excel,
can read. XML is a possibility - I've used it several times in other
projects - but can Excel read JSON? CSV seems to be the most familiar to
the end users.

Patricia

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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