On 15/11/2010 15:11, Derrell Lipman wrote:
On Mon, Nov 15, 2010 at 09:03, Joffrey Fuhrer - NOVLOG <[email protected] <mailto:[email protected]>> wrote:

    By saying "process something as a file", what I really meant in this
    particular use-case is that I want the browser to trigger a download.
    The problem I encountered when trying to use qx.io.remote.Request was
    that the browser I used was never made aware of this CSV file I was
    sending back; and as I understand it, the content of this file was
    probably "captured" in the "Response" object - which is what I
    don't want because then I don't know how to output something as a
    file in JS : in fact, that is why we do a server call.

    So basically the idea is what I tried to summarize in the title of
    this thread : I want to trigger a file download from a qooxdoo app,
    using as much "qooxdoo magic" as possible, but without having my
    app put its hands on the server's response.


Hmmm... You don't want the app to put its hands on the response. So what do you want to happen with that response? Do you want it displayed someplace? You could create an Iframe and set the Iframe's src attribute so that the file gets loaded into that Iframe, but if the file is a CSV file and not HTML, it won't render properly. All of the newlines will become single spaces, and the whole thing will end up on one messy line. If the CSV file is preprocessed at the server to instead be HTML that displays comma-separated values and then has a <br> tag, you'd get the proper appearance, but it's no longer downloading a CSV file.

If the data needn't be displayed, then the former idea may actually work. If the data is coming from the same origin as your application, you then, I believe, have access to the Iframe's data (via innerHTML? I don't recall) and can extract it. But you said you don't want the application involved, so I still don't understand your goal here.

Derrell

No, I don't need to display the data on the screen: in the end,
I want the application user to have a "whatever.csv" file on his
filesystem that he'll be able to open with whatever application he wants to
use: Excel, opencalc, google docs... Just as if I provided him with a link
like http://hello-world.com/whatever.csv


Thank you once again,

--
Joffrey Fuhrer
NOVLOG Intern

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to