2

I have an application that displays a large set of data using Slickgrid. The dataset may be 30-50MB in size. I would like users to be able to download the current view of the data displayed. What is the best way to set this up?

I have considered the approach described here using data URIs, but the maximum size of a URI is much too small.

I have also considered the approach described here where the client posts arbitrary data to the server, which the server echos back as a download. I worry that the documents may exceed the maximum POST size.

Community
  • 1
  • 1
Willi Ballenthin
  • 6,444
  • 6
  • 38
  • 52
  • Where is the data generated? It is hosted on your server? (Are you using SlickGrid's AJAX loading?) – josh3736 Aug 10 '12 at 19:08
  • I am not using the AJAX loading. I would like to be able to export the current view, which includes only the rows that are not filtered, etc. Due to this, you can assume the data is generated client side. – Willi Ballenthin Aug 10 '12 at 19:15
  • So how does the client get its data originally? – josh3736 Aug 10 '12 at 19:28
  • The client loads a large set of data on the initial load, and then the user modifies data, filters data, and sorts on various columns. The server hosts an initial set of data that is subsequently modified by each user of the application. – Willi Ballenthin Aug 10 '12 at 19:44
  • The modification is probably the hardest part to deal with. Otherwise, I'd just send filter and sort state to the server, apply that to the dataset, and push a CSV back to the client. – josh3736 Aug 10 '12 at 20:07
  • Yeah. This question is more focused on how to do this nearly strictly client-side. I see what you are getting at, though ;-) – Willi Ballenthin Aug 10 '12 at 20:22

2 Answers2

0

Since you want to do this on client side and If HTML5 is an option why not HTML5 File System API

defau1t
  • 10,593
  • 2
  • 35
  • 47
  • The downside of the file APIs is that you only get access to a sandboxed area on disk manged by the browser. In other words, you can't actually write the file to the user's documents folder. – josh3736 Aug 10 '12 at 19:12
  • Requiring Chrome today is not ideal, but may be reasonable. I will look into this. Can you think of any solutions that are not fragmented across browsers? – Willi Ballenthin Aug 10 '12 at 19:17
  • @WilliBallenthin: firefox too has god support for file api, but not as god as chrome. but I am sure you can get started. – defau1t Aug 10 '12 at 19:23
0

One option is to use the HTML5 FileWriter API. As of today it's only supported in Chrome (and the BlackBerry browser of all things).

mwcz
  • 8,949
  • 10
  • 42
  • 63
  • The downside of the file APIs is that you only get access to a sandboxed area on disk manged by the browser. In other words, you can't actually write the file to the user's documents folder. – josh3736 Aug 10 '12 at 19:12