Download Button

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Download Button

banal
Hello List

In my application I'd like to provide a "download-File" option to the
user. Now I'm wondering how this is accomplished best using qooxdoo. Is
there a way to have a button trigger a file download? Do i have to set
the Request transport to "Iframe"?
Apparently, there's no responseType "application/octet-stream" or
similar. What do i set the responseType to then?
Can it even be accomplished using the qooxdoo io classes?

Or do I have to put a <a href=""> somewhere in a Label (with HTML
Formatting)?

Any input is appreciated.
Thanks - Roman


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

Jonathan Weiß
Hello Roman,


this is an interesting topic. I would create an qx.ui.embed.Iframe, hide it and set the "source" property to the download file.
Please let me know if this works for you.

Kind regards,
Jonathan


On 12.02.2009, at 15:53, Roman Schmid wrote:

Hello List

In my application I'd like to provide a "download-File" option to the
user. Now I'm wondering how this is accomplished best using qooxdoo. Is
there a way to have a button trigger a file download? Do i have to set
the Request transport to "Iframe"?
Apparently, there's no responseType "application/octet-stream" or
similar. What do i set the responseType to then?
Can it even be accomplished using the qooxdoo io classes?

Or do I have to put a <a href=""> somewhere in a Label (with HTML
Formatting)?

Any input is appreciated.
Thanks - Roman


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Jonathan Weiß
Framework Engineer

Blog - LinkedIn - XING
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

level420
In reply to this post by banal
Hi Roman!

I'm simply doing a

    window.open(url);

within the execute event listener for the button.

That used to work 'til now.


Roman Schmid schrieb:

> Hello List
>
> In my application I'd like to provide a "download-File" option to the
> user. Now I'm wondering how this is accomplished best using qooxdoo. Is
> there a way to have a button trigger a file download? Do i have to set
> the Request transport to "Iframe"?
> Apparently, there's no responseType "application/octet-stream" or
> similar. What do i set the responseType to then?
> Can it even be accomplished using the qooxdoo io classes?
>
> Or do I have to put a <a href=""> somewhere in a Label (with HTML
> Formatting)?
>
> Any input is appreciated.
> Thanks - Roman
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

--
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner




------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

Fink, Andreas
Hi Roman,

my first solution for a download you mentioned was window.open. Its works perfect on development with localhost.
But after deployment on a webserver the popup-blockers of the several clients made problems and it didn't work with every security setting.

Then I've implemented an invisible IFrame (width and height = 0), like Jonathan mentioned in his post.
The only problem is that the client browsers blocking the download the first time and if the user allows to download the site gets reloaded.
After that the downloads work perfect.

I simple start the downloads with a small function:

startDownload : function(url) {
  //have to reset the source if the same download was requested before!
  if (dlFrame.getSource() === url) {
    dlFrame.resetSource();
  }
  dlFrame.setSource(url);  
}

-----Ursprüngliche Nachricht-----
Von: Dietrich Streifert [mailto:[hidden email]]
Gesendet: Freitag, 13. Februar 2009 08:22
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Download Button

Hi Roman!

I'm simply doing a

    window.open(url);

within the execute event listener for the button.

That used to work 'til now.


Roman Schmid schrieb:

> Hello List
>
> In my application I'd like to provide a "download-File" option to the
> user. Now I'm wondering how this is accomplished best using qooxdoo. Is
> there a way to have a button trigger a file download? Do i have to set
> the Request transport to "Iframe"?
> Apparently, there's no responseType "application/octet-stream" or
> similar. What do i set the responseType to then?
> Can it even be accomplished using the qooxdoo io classes?
>
> Or do I have to put a <a href=""> somewhere in a Label (with HTML
> Formatting)?
>
> Any input is appreciated.
> Thanks - Roman
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

--
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner




------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

banal
Hello All

Thanks a lot for your replies. Really helpful.
I implemented the iFrame method and it works perfectly (at least in FF 3
and Safari 3 on Mac).
Setting the width and height alone didn't render the iframe as invisible
though. I had to add a different decorator as well.

---- snip ----
this._dlFrame = new qx.ui.embed.Iframe("");
this._add(this._dlFrame);
this._dlFrame.set({
        width: 0,
        height: 0,
        decorator : new qx.ui.decoration.Background("transparent")
});
---- snip ----

Best - Roman

Fink, Andreas wrote:

> Hi Roman,
>
> my first solution for a download you mentioned was window.open. Its works perfect on development with localhost.
> But after deployment on a webserver the popup-blockers of the several clients made problems and it didn't work with every security setting.
>
> Then I've implemented an invisible IFrame (width and height = 0), like Jonathan mentioned in his post.
> The only problem is that the client browsers blocking the download the first time and if the user allows to download the site gets reloaded.
> After that the downloads work perfect.
>
> I simple start the downloads with a small function:
>
> startDownload : function(url) {
>   //have to reset the source if the same download was requested before!
>   if (dlFrame.getSource() === url) {
>     dlFrame.resetSource();
>   }
>   dlFrame.setSource(url);  
> }
>
> -----Ursprüngliche Nachricht-----
> Von: Dietrich Streifert [mailto:[hidden email]]
> Gesendet: Freitag, 13. Februar 2009 08:22
> An: qooxdoo Development
> Betreff: Re: [qooxdoo-devel] Download Button
>
> Hi Roman!
>
> I'm simply doing a
>
>     window.open(url);
>
> within the execute event listener for the button.
>
> That used to work 'til now.
>
>
> Roman Schmid schrieb:
>> Hello List
>>
>> In my application I'd like to provide a "download-File" option to the
>> user. Now I'm wondering how this is accomplished best using qooxdoo. Is
>> there a way to have a button trigger a file download? Do i have to set
>> the Request transport to "Iframe"?
>> Apparently, there's no responseType "application/octet-stream" or
>> similar. What do i set the responseType to then?
>> Can it even be accomplished using the qooxdoo io classes?
>>
>> Or do I have to put a <a href=""> somewhere in a Label (with HTML
>> Formatting)?
>>
>> Any input is appreciated.
>> Thanks - Roman
>>
>>
>> ------------------------------------------------------------------------------
>> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
>> software. With Adobe AIR, Ajax developers can use existing skills and code to
>> build responsive, highly engaging applications that combine the power of local
>> resources and data with the reach of the web. Download the Adobe AIR SDK and
>> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>  
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

Sebastian Werner
decorator:null

should work as well :)

Cheers,
Sebastian


Roman Schmid schrieb:

> Hello All
>
> Thanks a lot for your replies. Really helpful.
> I implemented the iFrame method and it works perfectly (at least in FF 3
> and Safari 3 on Mac).
> Setting the width and height alone didn't render the iframe as invisible
> though. I had to add a different decorator as well.
>
> ---- snip ----
> this._dlFrame = new qx.ui.embed.Iframe("");
> this._add(this._dlFrame);
> this._dlFrame.set({
> width: 0,
> height: 0,
> decorator : new qx.ui.decoration.Background("transparent")
> });
> ---- snip ----
>
> Best - Roman
>
> Fink, Andreas wrote:
>> Hi Roman,
>>
>> my first solution for a download you mentioned was window.open. Its works perfect on development with localhost.
>> But after deployment on a webserver the popup-blockers of the several clients made problems and it didn't work with every security setting.
>>
>> Then I've implemented an invisible IFrame (width and height = 0), like Jonathan mentioned in his post.
>> The only problem is that the client browsers blocking the download the first time and if the user allows to download the site gets reloaded.
>> After that the downloads work perfect.
>>
>> I simple start the downloads with a small function:
>>
>> startDownload : function(url) {
>>   //have to reset the source if the same download was requested before!
>>   if (dlFrame.getSource() === url) {
>>     dlFrame.resetSource();
>>   }
>>   dlFrame.setSource(url);  
>> }
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Dietrich Streifert [mailto:[hidden email]]
>> Gesendet: Freitag, 13. Februar 2009 08:22
>> An: qooxdoo Development
>> Betreff: Re: [qooxdoo-devel] Download Button
>>
>> Hi Roman!
>>
>> I'm simply doing a
>>
>>     window.open(url);
>>
>> within the execute event listener for the button.
>>
>> That used to work 'til now.
>>
>>
>> Roman Schmid schrieb:
>>> Hello List
>>>
>>> In my application I'd like to provide a "download-File" option to the
>>> user. Now I'm wondering how this is accomplished best using qooxdoo. Is
>>> there a way to have a button trigger a file download? Do i have to set
>>> the Request transport to "Iframe"?
>>> Apparently, there's no responseType "application/octet-stream" or
>>> similar. What do i set the responseType to then?
>>> Can it even be accomplished using the qooxdoo io classes?
>>>
>>> Or do I have to put a <a href=""> somewhere in a Label (with HTML
>>> Formatting)?
>>>
>>> Any input is appreciated.
>>> Thanks - Roman
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
>>> software. With Adobe AIR, Ajax developers can use existing skills and code to
>>> build responsive, highly engaging applications that combine the power of local
>>> resources and data with the reach of the web. Download the Adobe AIR SDK and
>>> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>  
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

Hugh Gibson-2
In reply to this post by Fink, Andreas
> my first solution for a download you mentioned was window.open. Its
> works perfect on development with localhost.
> But after deployment on a webserver the popup-blockers of the
> several clients made problems and it didn't work with every
> security setting.

If you simplify the javascript that opens the window you may be able to
bypass the blockers. See http://javascript.about.com/library/blblock.htm
for more information.

Hugh

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

level420
In reply to this post by banal
Hi Roman,

I've implemented the hidden iframe method for downloads but run into the problem that IE7, Safari 3 and Chrome 2 on Windows successfully load the file but then they do not show a "save as" dialog.

This is for downloads of streamed PDF-Files.

The sets the header properties for the answer to "ContentType"="application/pdf" and "Content-disposition"="inline; filename=test.pdf".

I think that the hidden iframe loads the PDF-File and, well, shows the content hidden.

How did you solve this problem?



Roman Schmid schrieb:
Hello All

Thanks a lot for your replies. Really helpful.
I implemented the iFrame method and it works perfectly (at least in FF 3
and Safari 3 on Mac).
Setting the width and height alone didn't render the iframe as invisible
though. I had to add a different decorator as well.

---- snip ----
this._dlFrame = new qx.ui.embed.Iframe("");
this._add(this._dlFrame);
this._dlFrame.set({
	width: 0,
	height: 0,
	decorator : new qx.ui.decoration.Background("transparent")
});
---- snip ----

Best - Roman

Fink, Andreas wrote:
  
Hi Roman,

my first solution for a download you mentioned was window.open. Its works perfect on development with localhost.
But after deployment on a webserver the popup-blockers of the several clients made problems and it didn't work with every security setting.

Then I've implemented an invisible IFrame (width and height = 0), like Jonathan mentioned in his post.
The only problem is that the client browsers blocking the download the first time and if the user allows to download the site gets reloaded.
After that the downloads work perfect.

I simple start the downloads with a small function: 

startDownload : function(url) {
  //have to reset the source if the same download was requested before!
  if (dlFrame.getSource() === url) {
    dlFrame.resetSource();
  }
  dlFrame.setSource(url);  
}

-----Ursprüngliche Nachricht-----
Von: Dietrich Streifert [[hidden email]] 
Gesendet: Freitag, 13. Februar 2009 08:22
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Download Button

Hi Roman!

I'm simply doing a

    window.open(url);

within the execute event listener for the button.

That used to work 'til now.


Roman Schmid schrieb:
    
Hello List

In my application I'd like to provide a "download-File" option to the
user. Now I'm wondering how this is accomplished best using qooxdoo. Is
there a way to have a button trigger a file download? Do i have to set
the Request transport to "Iframe"?
Apparently, there's no responseType "application/octet-stream" or
similar. What do i set the responseType to then?
Can it even be accomplished using the qooxdoo io classes?

Or do I have to put a <a href=""> somewhere in a Label (with HTML
Formatting)?

Any input is appreciated.
Thanks - Roman


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
  
      

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
  

-- 
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner



------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

banal
Hi Dietrich

This is what I have in my PHP script that returns the files:

header('Content-Description: File download', true);
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream');
header('Content-Type: application/download');
header('Content-Disposition: attachment; filename='.
urlencode($fileName), true);
header('Content-Transfer-Encoding: binary', true);
header('Expires: 0', true);
header('Cache-Control: must-revalidate, post-check=0, pre-check=0', true);
header('Pragma: public', true);
header('Content-Length: '. filesize($filePath), true);
               
$fp = @fopen($filePath, 'r');
while (!feof($fp))
{
    echo fread($fp, 65536);
    flush(); // this is essential for large downloads
}
fclose($fp);

Works fine in all major Browsers so far...
Best - Roman

Dietrich Streifert wrote:

> Hi Roman,
>
> I've implemented the hidden iframe method for downloads but run into the
> problem that IE7, Safari 3 and Chrome 2 on Windows successfully load the
> file but then they do not show a "save as" dialog.
>
> This is for downloads of streamed PDF-Files.
>
> The sets the header properties for the answer to
> "ContentType"="application/pdf" and "Content-disposition"="inline;
> filename=test.pdf".
>
> I think that the hidden iframe loads the PDF-File and, well, shows the
> content hidden.
>
> How did you solve this problem?
>
>
>
> Roman Schmid schrieb:
>> Hello All
>>
>> Thanks a lot for your replies. Really helpful.
>> I implemented the iFrame method and it works perfectly (at least in FF 3
>> and Safari 3 on Mac).
>> Setting the width and height alone didn't render the iframe as invisible
>> though. I had to add a different decorator as well.
>>
>> ---- snip ----
>> this._dlFrame = new qx.ui.embed.Iframe("");
>> this._add(this._dlFrame);
>> this._dlFrame.set({
>> width: 0,
>> height: 0,
>> decorator : new qx.ui.decoration.Background("transparent")
>> });
>> ---- snip ----
>>
>> Best - Roman
>>
>> Fink, Andreas wrote:
>>  
>>> Hi Roman,
>>>
>>> my first solution for a download you mentioned was window.open. Its works perfect on development with localhost.
>>> But after deployment on a webserver the popup-blockers of the several clients made problems and it didn't work with every security setting.
>>>
>>> Then I've implemented an invisible IFrame (width and height = 0), like Jonathan mentioned in his post.
>>> The only problem is that the client browsers blocking the download the first time and if the user allows to download the site gets reloaded.
>>> After that the downloads work perfect.
>>>
>>> I simple start the downloads with a small function:
>>>
>>> startDownload : function(url) {
>>>   //have to reset the source if the same download was requested before!
>>>   if (dlFrame.getSource() === url) {
>>>     dlFrame.resetSource();
>>>   }
>>>   dlFrame.setSource(url);  
>>> }
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Dietrich Streifert [mailto:[hidden email]]
>>> Gesendet: Freitag, 13. Februar 2009 08:22
>>> An: qooxdoo Development
>>> Betreff: Re: [qooxdoo-devel] Download Button
>>>
>>> Hi Roman!
>>>
>>> I'm simply doing a
>>>
>>>     window.open(url);
>>>
>>> within the execute event listener for the button.
>>>
>>> That used to work 'til now.
>>>
>>>
>>> Roman Schmid schrieb:
>>>    
>>>> Hello List
>>>>
>>>> In my application I'd like to provide a "download-File" option to the
>>>> user. Now I'm wondering how this is accomplished best using qooxdoo. Is
>>>> there a way to have a button trigger a file download? Do i have to set
>>>> the Request transport to "Iframe"?
>>>> Apparently, there's no responseType "application/octet-stream" or
>>>> similar. What do i set the responseType to then?
>>>> Can it even be accomplished using the qooxdoo io classes?
>>>>
>>>> Or do I have to put a <a href=""> somewhere in a Label (with HTML
>>>> Formatting)?
>>>>
>>>> Any input is appreciated.
>>>> Thanks - Roman
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
>>>> software. With Adobe AIR, Ajax developers can use existing skills and code to
>>>> build responsive, highly engaging applications that combine the power of local
>>>> resources and data with the reach of the web. Download the Adobe AIR SDK and
>>>> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>  
>>>>      
>>
>> ------------------------------------------------------------------------------
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>> -Strategies to boost innovation and cut costs with open source participation
>> -Receive a $600 discount off the registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>  
>
> --
> Mit freundlichen Grüßen
> Dietrich Streifert
> --
> Visionet GmbH
> Firmensitz: Am Weichselgarten 7, 91058 Erlangen
> Registergericht: Handelsregister Fürth, HRB 6573
> Geschäftsführer: Stefan Lindner
>
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Download Button

level420
In reply to this post by level420
Just a few minutes and answering to myself :-( Bad boy ;-)

Setting the Content-disposition to "attachment; filename=test.pdf" obviously triggers a file download and avoids the file view within the browser.

I think I decided (years ago) to use inline because of some restrictive firewall settings of a customer where all attachment header files were filtered.



Dietrich Streifert schrieb:
Hi Roman,

I've implemented the hidden iframe method for downloads but run into the problem that IE7, Safari 3 and Chrome 2 on Windows successfully load the file but then they do not show a "save as" dialog.

This is for downloads of streamed PDF-Files.

The sets the header properties for the answer to "ContentType"="application/pdf" and "Content-disposition"="inline; filename=test.pdf".

I think that the hidden iframe loads the PDF-File and, well, shows the content hidden.

How did you solve this problem?



Roman Schmid schrieb:
Hello All

Thanks a lot for your replies. Really helpful.
I implemented the iFrame method and it works perfectly (at least in FF 3
and Safari 3 on Mac).
Setting the width and height alone didn't render the iframe as invisible
though. I had to add a different decorator as well.

---- snip ----
this._dlFrame = new qx.ui.embed.Iframe("");
this._add(this._dlFrame);
this._dlFrame.set({
	width: 0,
	height: 0,
	decorator : new qx.ui.decoration.Background("transparent")
});
---- snip ----

Best - Roman
    
-- 
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner



------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel