File Download (XForms & IE7)

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

File Download (XForms & IE7)

Markku Laine
Hi all,


I am experiencing a weird behaviour with IE7+OF combo when trying to
download a file from the server.

I have a servlet running at http://localhost:8080/download/file, which
returns a file read from the file system. In the response, I am using,
among others, the "Content-Disposition" header having the
following value: "attachment; filename=" + fileName.

When I send a direct request to the URL, the Open/Save dialog appears as a
response, in which I can choose to, for example, save the file on my
computer. Everything okay so far, and this works with all browsers,
including IE6, IE7, and Firefox 2.

In the next step, I created a Web page having two kinds of links: XForms
link (xforms:load) and XHTML link (xhtml:a). In both cases, the link
should open the content to a new window plus the Open/Save dialog should
appear. The authored markup as well as the transformed result(s) can be
seen below:

Authored markup:
----------------
...
<xforms:trigger appearance="minimal">
   <xforms:label>XForms download link</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:load resource="http://localhost:8080/download/file"
show="new"/>
   </xforms:action>
</xforms:trigger>
...
<a href="http://localhost:8080/download/file" target="_blank">XHTML
download link</a>
...

Transformed markup (Orbeon Forms):
----------------------------------
<a id="xforms-element-9" class="xforms-control xforms-trigger
xforms-trigger-appearance-minimal" href="#">XForms download link</a>
...
<a href="http://localhost:8080/download/file" target="_blank">XHTML
download link</a>


Now, when I am trying to download a file through the Web page everything
works fine in all browsers using the XHTML link. The XForms link
(xforms:load), however, does not work in IE7 but works in IE6 and
Firefox 2. In IE7, a pop-up window appears and then immediately
disappears plus does not show the Open/Save dialog at all. I even tested
the XForms link with another server-side XForms implementation, Chiba, but
Firefox 2 was the only browser which worked as supposed to with Chiba.

In both IE6 and IE7, I have used default settings for Downloads (Check
at Tools > Internet Options... > Security tab > Custom Level...):
Downloads:
  - Automatic prompting for file downloads: Disable
  - File download: Enable


There are two options (as far as I know) to make file downloading
using XForms link possible in IE7: (1) CTRL click the XForms link
or (2) set Automatic prompting for file downloads to Enable.
Unfortunately, neither of these tricks are user friendly options :(

What I do not understand is what is the difference between a XHTML link
(xhtml:a) and an XForms link (xforms:load) when opened to a new window?
The transformation result looks pretty much the same but there must be
something odd happening in Orbeon Forms (?) which prevents opening the
Open/Save dialog.

Has anybody experienced the same odd behaviour before? Any known work
arounds?

I tested the behaviour using the latest nightly build from Orbeon Forms
(and Chiba).

Kind regards


-Markku Laine


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: File Download (XForms & IE7)

Markku Laine
Hi,


Continued my tests regarding the weird behaviour with IE7+Orbeon Forms
when trying to download a file from the server.

Didn't find any working solution to the problem and I am still unable to
download files using IE7&Orbeon Forms.

I also tried file downloading with other XForms engines to see weather or
not the problem is in the XForms implementation of Orbeon Forms. IE7&Chiba
didn't work but IE7&FormsPlayer (plug-in) worked fine. So I guess the
problem is in XForms implementation of Orbeon Forms.

Attached needed files & instructions for testing the behaviour. Could
somebody try it out and confirm my findings (and create a bug report if
needed)?

Just put the download.war to you servlet container and download the latest
nightly build version of Orbeon Forms and put the filedownload.jsp file
under the xforms-jsp folder. Then go to the URL of filedownload.jsp
(http://localhost:8080/orbeon/xforms-jsp/filedownload.jsp) and read
instructions plus test.

Kind regards


-Markku Laine

On Tue, 3 Feb 2009, .::: Markku :::. wrote:

> Hi all,
>
>
> I am experiencing a weird behaviour with IE7+OF combo when trying to download
> a file from the server.
>
> I have a servlet running at http://localhost:8080/download/file, which
> returns a file read from the file system. In the response, I am using, among
> others, the "Content-Disposition" header having the following value:
> "attachment; filename=" + fileName.
>
> When I send a direct request to the URL, the Open/Save dialog appears as a
> response, in which I can choose to, for example, save the file on my
> computer. Everything okay so far, and this works with all browsers, including
> IE6, IE7, and Firefox 2.
>
> In the next step, I created a Web page having two kinds of links: XForms link
> (xforms:load) and XHTML link (xhtml:a). In both cases, the link should open
> the content to a new window plus the Open/Save dialog should appear. The
> authored markup as well as the transformed result(s) can be seen below:
>
> Authored markup:
> ----------------
> ...
> <xforms:trigger appearance="minimal">
>   <xforms:label>XForms download link</xforms:label>
>   <xforms:action ev:event="DOMActivate">
>    <xforms:load resource="http://localhost:8080/download/file"
> show="new"/>
>  </xforms:action>
> </xforms:trigger>
> ...
> <a href="http://localhost:8080/download/file" target="_blank">XHTML
> download link</a>
> ...
>
> Transformed markup (Orbeon Forms):
> ----------------------------------
> <a id="xforms-element-9" class="xforms-control xforms-trigger
> xforms-trigger-appearance-minimal" href="#">XForms download link</a>
> ...
> <a href="http://localhost:8080/download/file" target="_blank">XHTML
> download link</a>
>
>
> Now, when I am trying to download a file through the Web page everything
> works fine in all browsers using the XHTML link. The XForms link
> (xforms:load), however, does not work in IE7 but works in IE6 and Firefox 2.
> In IE7, a pop-up window appears and then immediately disappears plus does not
> show the Open/Save dialog at all. I even tested the XForms link with another
> server-side XForms implementation, Chiba, but Firefox 2 was the only browser
> which worked as supposed to with Chiba.
>
> In both IE6 and IE7, I have used default settings for Downloads (Check at
> Tools > Internet Options... > Security tab > Custom Level...):
> Downloads:
>  - Automatic prompting for file downloads: Disable
>  - File download: Enable
>
>
> There are two options (as far as I know) to make file downloading using
> XForms link possible in IE7: (1) CTRL click the XForms link or (2) set
> Automatic prompting for file downloads to Enable. Unfortunately, neither of
> these tricks are user friendly options :(
>
> What I do not understand is what is the difference between a XHTML link
> (xhtml:a) and an XForms link (xforms:load) when opened to a new window? The
> transformation result looks pretty much the same but there must be something
> odd happening in Orbeon Forms (?) which prevents opening the Open/Save
> dialog.
>
> Has anybody experienced the same odd behaviour before? Any known work
> arounds?
>
> I tested the behaviour using the latest nightly build from Orbeon Forms (and
> Chiba).
>
> Kind regards
>
>
> -Markku Laine
>
>
--
Markku Laine <[hidden email]>, Research assistant
Helsinki University of Technology
Department of Media Technology
P.O. BOX 5400, FI-02015 HUT, FINLAND
Mobile. +358-50-565 8179

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

filedownload.jsp (9K) Download Attachment
download.war (39K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: File Download (XForms & IE7)

Alessandro Vernet
Administrator
Markku,

Markku Laine wrote
Attached needed files & instructions for testing the behaviour. Could
somebody try it out and confirm my findings (and create a bug report if
needed)?
Thank you for the test case; I was able to reproduce this. Working with lots of different browser is fun, isn't it? ;)

When you do a <xforms:load ref="instance( 'file-download-instance' )/file4" show="new" />, down the road the JavaScript runs window.open(resource, "_blank") (where resource is the URL you specified). So you think that this is equivalent to , but as you noticed it isn't on IE7. Now, removing the show="new" solves the problem for me. It will just try to replace the content of the current window, get a file to download, and ask users if they want to save it. That works fine with Firefox, IE6, and IE7.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: File Download (XForms & IE7)

Markku Laine
Hi Alex,


Thanks for taking a look at the issue.


> Thank you for the test case; I was able to reproduce this. Working with lots
> of different browser is fun, isn't it? ;)

Yes, that's my favorite activity :)


> When you do a <xforms:load ref="instance( 'file-download-instance' )/file4"
> show="new" />, down the road the JavaScript runs window.open(resource,
> "_blank") (where resource is the URL you specified). So you think that this
> is equivalent to  resource , but as you noticed it isn't on IE7. Now,
> removing the show="new" solves the problem for me. It will just try to
> replace the content of the current window, get a file to download, and ask
> users if they want to save it. That works fine with Firefox, IE6, and IE7.

I removed the show="new" attribute (equivalent to show="replace") and
tested the web app again with IE7, and other browsers as well.

IE7: Like you said removing the attribute solves the problem - but
only partly. Now, when you click the "Download (XForms)" link on the
web page for the first time a security tab or something pops up saying:
"To help protect your security, Internet Explorer blocked this site from
downloading files to your computer. Click here for options...". Then, if
you click the tab and select the "Download File..." option, the web page
reloads itself and you are back to square one. Now, clicking the link for
the second time everything works as planned - a File Download dialog opens
with the following options: Open, Save, and Cancel.

However, there is still one minor problem. No matter which option you
choose Orbeon Forms' loading indication won't disappear. There is a
workaround for this one by adding the xxforms:show-progress="false"
attribute to the xforms:load element.

FF2: Works fine with the show="new" attribute and has the "loading
indicator" problem when using with the show="replace" attribute.


The question is, your suggestion partly solves the problem but is there a
more elegant way to handle this issue than defining the link as
<xforms:load ref="instance( 'file-download-instance' )/file4"
xxforms:show-progress="false" show="replace" />? Or could Orbeon Forms, in
some way, support the show="new" attribute with IE7 in the future?

Thanks again for your help Alex.

Kind regards


-Markku

Ps. I tested the web app only with Orbeon Forms 3.6.0.200712081809.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: File Download (XForms & IE7)

Alessandro Vernet
Administrator
Markku,

Markku Laine wrote
IE7: Like you said removing the attribute solves the problem - but
only partly. Now, when you click the "Download (XForms)" link on the
web page for the first time a security tab or something pops up saying:
"To help protect your security, Internet Explorer blocked this site from
downloading files to your computer. Click here for options...".
The "right" (= it works) way of doing this is by having in the page a static link () pointing to your file. If you have the file in an instance (or a URI to the file), that mean you have to do a service to serve the file, pass some information to the service so it can find the file, bla, bla. All this is annoying to do, so we provide an xxforms:download appearance for the <xforms:output> which does all this boring for you. See:

http://www.orbeon.com/ops/doc/reference-xforms-extensions#xxforms-download-appearance

This method has some limitations since you need to have on the page a link on which users click, but this is what I'd recommend for this case.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: File Download (XForms & IE7)

Markku Laine
Alex,


>> IE7: Like you said removing the attribute solves the problem - but
>> only partly. Now, when you click the "Download (XForms)" link on the
>> web page for the first time a security tab or something pops up saying:
>> "To help protect your security, Internet Explorer blocked this site from
>> downloading files to your computer. Click here for options...".
>>
>
> The "right" (= it works) way of doing this is by having in the page a static
> link ( ... ) pointing to your file. If you have the file in an instance (or
> a URI to the file), that mean you have to do a service to serve the file,
> pass some information to the service so it can find the file, bla, bla. All
> this is annoying to do, so we provide an xxforms:download appearance for the
> <xforms:output> which does all this boring for you. See:
>
> http://www.orbeon.com/ops/doc/reference-xforms-extensions#xxforms-download-appearance
>
> This method has some limitations since you need to have on the page a link
> on which users click, but this is what I'd recommend for this case.
Thanks for the tip. Actually, I have already tried xxforms:download before
but as you said it has some limitations:
  * It's an Orbeon Forms XForms extension (not standard XForms)
  * It does not work when cookies are disabled by the browser
  * In IE7, it opens (replaces the current content of the Web page), for
example, a downloaded image to the browser i.e. displays it instead of
showing the File Download dialog
  * It works with a clickable link only

I have already created my own service which serves files, just like
xxforms:download, and it works well except with IE7. For this reason,
I would like to ask, could it be possible for Orbeon Forms to support
the show="new" attribute of the xforms:load element? Or is this even
technically possible to implement?

Kind regards


-Markku


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: File Download (XForms & IE7)

Alessandro Vernet
Administrator
Markku,

Markku Laine wrote
Thanks for the tip. Actually, I have already tried xxforms:download before
but as you said it has some limitations:
  * It's an Orbeon Forms XForms extension (not standard XForms)
  * It does not work when cookies are disabled by the browser
  * In IE7, it opens (replaces the current content of the Web page), for
example, a downloaded image to the browser i.e. displays it instead of
showing the File Download dialog
  * It works with a clickable link only
Given the way browsers work, we can't do much about this, except your 3rd item above. I also noticed that behavior with IE7 (as well as Safari and Opera, so Firefox seems to be the exception here). Did you see anything that is missing in the headers we send to the browser for IE7 to ask the user to download the file instead of showing it?

Markku Laine wrote
I have already created my own service which serves files, just like
xxforms:download, and it works well except with IE7. For this reason,
I would like to ask, could it be possible for Orbeon Forms to support
the show="new" attribute of the xforms:load element? Or is this even
technically possible to implement?
<xforms:load show="new"> is already supported. You can find an example in the action-load.xhtml sandbox example (http://localhost:8080/orbeon/xforms-sandbox/sample/action-load).

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: File Download (XForms & IE7)

Markku Laine
In reply to this post by Markku Laine
> I have already created my own service which serves files, just like
> xxforms:download, and it works well except with IE7. For this reason, I would
> like to ask, could it be possible for Orbeon Forms to support the show="new"
> attribute of the xforms:load element? Or is this even technically possible to
> implement?

Of course, meaning here that the show="new" attribute of the xforms:load
element would behave in IE7 like in other browsers or that the like <a
href="..." /> in IE7.

Regards


-Markku


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: File Download (XForms & IE7)

Ryan Puddephatt-3
In reply to this post by Markku Laine
Alex,
   You could set the content type to application/octet-stream that will force all browsers to do a download. That's how I've got around it in the past

Thanks

Ryan
-----------------------------------------------
Ryan Puddephatt
Connectivity Developer
Fidessa LatentZero
1 Old Jewry
London EC2R 8DN
Office: +44 (0) 20 7105 1000
Direct: +44 (0) 20 7105 1821
Blackberry: +44 (0) 79 8539 2458
Fax: +44 (0) 20 7105 1818
Email: [hidden email]
Web: http://www.latentzero.com


----- Original Message -----
From: Alessandro  Vernet <[hidden email]>
To: [hidden email] <[hidden email]>
Sent: Thu Mar 19 23:40:01 2009
Subject: [ops-users] Re: Re: Re: File Download (XForms & IE7)


Markku,


Markku Laine wrote:

>
> Thanks for the tip. Actually, I have already tried xxforms:download before
> but as you said it has some limitations:
>   * It's an Orbeon Forms XForms extension (not standard XForms)
>   * It does not work when cookies are disabled by the browser
>   * In IE7, it opens (replaces the current content of the Web page), for
> example, a downloaded image to the browser i.e. displays it instead of
> showing the File Download dialog
>   * It works with a clickable link only
>
Given the way browsers work, we can't do much about this, except your 3rd
item above. I also noticed that behavior with IE7 (as well as Safari and
Opera, so Firefox seems to be the exception here). Did you see anything that
is missing in the headers we send to the browser for IE7 to ask the user to
download the file instead of showing it?


Markku Laine wrote:
>
> I have already created my own service which serves files, just like
> xxforms:download, and it works well except with IE7. For this reason,
> I would like to ask, could it be possible for Orbeon Forms to support
> the show="new" attribute of the xforms:load element? Or is this even
> technically possible to implement?
>

<xforms:load show="new"> is already supported. You can find an example in
the action-load.xhtml sandbox example
(http://localhost:8080/orbeon/xforms-sandbox/sample/action-load).

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/File-Download-%28XForms---IE7%29-tp21814039p22611712.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

_______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: File Download (XForms & IE7)

Markku Laine
Ryan,


Thanks for the tip! I gave it a try by doing the following modifications
to my response handler:
BEFORE:
...
response.setContentType( contentType );
response.addHeader( "Content-Disposition", "attachment; filename=" +
fileName );
...

NOW:
...
response.setContentType( "application/octet-stream" );
//response.addHeader( "Content-Disposition", "attachment; filename=" +
fileName ); // REMOVED
...

Unfortunately, this did not help for me :( When I tried to download,
for example, a JPEG image, I got the following responses from different
browsers:
  * IE6: Opened/embedded the image to a new window
  * IE7: Opened/embedded the image to a new window
  * FF2: Opened the File Download dialog but the name of the file is the
same as the download URL's file name (not the name of the file to be
downloaded)

I used the following syntax for the download link:
<xforms:trigger appearance="minimal">
   <xforms:label>Download file</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:load ref="instance( 'download-url-instance' )" show="new" />
   </xforms:action>
</xforms:trigger>

Ryan, am I doing this right? If the workaround works for you with all
browsers could it be possible that you could share a simple web
application which demonstrates how this should be done correctly?

Alex, I tested my download link (the one above)/Web page combined with
my service which serves files with different XForms implementations
(without Ryan's modification) and got the following results:
Chiba (web 3.0.0b1):
  * IE6: does not work (opens a warning window with the text: "Session
Error")
  * IE7: does not work (a new window is opened but it disappears
immediately)
  * FF2: works as expected (opens the File Download dialog with the
correct file name etc.)

XSLTForms (beta 2009-02-03):
  * IE6: works as expected (opens the File Download dialog with the correct
file name etc.)
  * IE7: works as expected (opens the File Download dialog with the correct
file name etc.)
  * FF2: does not work (a # char is append to the URL but otherwise nothing
happens)

formsplayer (1.6.1030dev):
  * IE6: works as expected (opens the File Download dialog with the correct
file name etc.)
  * IE7: works as expected (opens the File Download dialog with the correct
file name etc.)

Orbeon Forms (nightly build):
  * IE6: works as expected (opens the File Download dialog with the correct
file name etc.)
  * IE7: does not work (a new window is opened but it disappears
immediately)
  * FF2: works as expected (opens the File Download dialog with the correct
file name etc.)


As you can see from the test results, Orbeon Forms works with IE6 and FF2
but not with IE7. XSLTForms and formsPlayer (plug-in), however, work with
IE7.

Today, I finally figured out a good workaround for this issue when using
Orbeon Forms as an XForms implementation - AVTs!
http://www.orbeon.com/ops/doc/reference-xforms-extensions#avts-xhtml

Instead of using the following syntax for the download link:
<xforms:trigger appearance="minimal">
   <xforms:label>Download file</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:load ref="instance( 'download-url-instance' )" show="new" />
   </xforms:action>
</xforms:trigger>

I am now using this syntax for the download link:
<a href="{instance( 'download-url-instance' )}" target="_blank">Download
file</a>

It works great with all the aforementioned browsers (IE6, IE7, and FF2).
The only downside of this solution is that the syntax is not XForms 1.1
compliant (contains Orbeon Forms extensions).

What I still don't quite understand is that howcome <xforms:load
resource="..." show="new" /> syntax does not work with IE7 in Orbeon
Forms? The service which serves files seems to be working well as well as
the syntax for downloading files with IE6 & FF2 in Orbeon Forms and with
IE7 in XSLTForms.

Thanks for all the help, Alex. I really appreciate it!!!

Regards


-Markku

On Fri, 20 Mar 2009, Ryan Puddephatt wrote:

> Alex,
>   You could set the content type to application/octet-stream that will force all browsers to do a download. That's how I've got around it in the past
>
> Thanks
>
> Ryan
> -----------------------------------------------
> Ryan Puddephatt
> Connectivity Developer
> Fidessa LatentZero
> 1 Old Jewry
> London EC2R 8DN
> Office: +44 (0) 20 7105 1000
> Direct: +44 (0) 20 7105 1821
> Blackberry: +44 (0) 79 8539 2458
> Fax: +44 (0) 20 7105 1818
> Email: [hidden email]
> Web: http://www.latentzero.com
>
>
> ----- Original Message -----
> From: Alessandro  Vernet <[hidden email]>
> To: [hidden email] <[hidden email]>
> Sent: Thu Mar 19 23:40:01 2009
> Subject: [ops-users] Re: Re: Re: File Download (XForms & IE7)
>
>
> Markku,
>
>
> Markku Laine wrote:
>>
>> Thanks for the tip. Actually, I have already tried xxforms:download before
>> but as you said it has some limitations:
>>   * It's an Orbeon Forms XForms extension (not standard XForms)
>>   * It does not work when cookies are disabled by the browser
>>   * In IE7, it opens (replaces the current content of the Web page), for
>> example, a downloaded image to the browser i.e. displays it instead of
>> showing the File Download dialog
>>   * It works with a clickable link only
>>
>
> Given the way browsers work, we can't do much about this, except your 3rd
> item above. I also noticed that behavior with IE7 (as well as Safari and
> Opera, so Firefox seems to be the exception here). Did you see anything that
> is missing in the headers we send to the browser for IE7 to ask the user to
> download the file instead of showing it?
>
>
> Markku Laine wrote:
>>
>> I have already created my own service which serves files, just like
>> xxforms:download, and it works well except with IE7. For this reason,
>> I would like to ask, could it be possible for Orbeon Forms to support
>> the show="new" attribute of the xforms:load element? Or is this even
>> technically possible to implement?
>>
>
> <xforms:load show="new"> is already supported. You can find an example in
> the action-load.xhtml sandbox example
> (http://localhost:8080/orbeon/xforms-sandbox/sample/action-load).
>
> Alex
>
> -----
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
> Twitter - http://twitter.com/avernet
> --
> View this message in context: http://www.nabble.com/File-Download-%28XForms---IE7%29-tp21814039p22611712.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> _______________________________________________________________________
> The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
>
--
Markku Laine <[hidden email]>, Research assistant
Helsinki University of Technology
Department of Media Technology
P.O. BOX 5400, FI-02015 HUT, FINLAND
Mobile. +358-50-565 8179


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Re: Re: Re: File Download (XForms & IE7)

Ryan Puddephatt-3
Markku,
   I actually used the HTTP Serializer processor to do it in an XPL

http://www.orbeon.com/ops/doc/processors-serializers-http

I had to set content-type and force-content-type to true....is it possible your not forcing the content type? Or that you could change your server to pass these url requests through an XPL that does this?

Thanks

Ryan
-----------------------------------------------
Ryan Puddephatt
Connectivity Developer
Fidessa LatentZero
1 Old Jewry
London EC2R 8DN
Office: +44 (0) 20 7105 1000
Direct: +44 (0) 20 7105 1821
Blackberry: +44 (0) 79 8539 2458
Fax: +44 (0) 20 7105 1818
Email: [hidden email]
Web: http://www.latentzero.com


-----Original Message-----
From: .::: Markku :::. [mailto:[hidden email]]
Sent: 20 March 2009 10:43
To: [hidden email]
Subject: [ops-users] Re: Re: Re: Re: Re: File Download (XForms & IE7)

Ryan,


Thanks for the tip! I gave it a try by doing the following modifications to my response handler:
BEFORE:
...
response.setContentType( contentType );
response.addHeader( "Content-Disposition", "attachment; filename=" + fileName ); ...

NOW:
...
response.setContentType( "application/octet-stream" ); //response.addHeader( "Content-Disposition", "attachment; filename=" + fileName ); // REMOVED ...

Unfortunately, this did not help for me :( When I tried to download, for example, a JPEG image, I got the following responses from different
browsers:
  * IE6: Opened/embedded the image to a new window
  * IE7: Opened/embedded the image to a new window
  * FF2: Opened the File Download dialog but the name of the file is the same as the download URL's file name (not the name of the file to be
downloaded)

I used the following syntax for the download link:
<xforms:trigger appearance="minimal">
   <xforms:label>Download file</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:load ref="instance( 'download-url-instance' )" show="new" />
   </xforms:action>
</xforms:trigger>

Ryan, am I doing this right? If the workaround works for you with all browsers could it be possible that you could share a simple web application which demonstrates how this should be done correctly?

Alex, I tested my download link (the one above)/Web page combined with my service which serves files with different XForms implementations (without Ryan's modification) and got the following results:
Chiba (web 3.0.0b1):
  * IE6: does not work (opens a warning window with the text: "Session
Error")
  * IE7: does not work (a new window is opened but it disappears
immediately)
  * FF2: works as expected (opens the File Download dialog with the correct file name etc.)

XSLTForms (beta 2009-02-03):
  * IE6: works as expected (opens the File Download dialog with the correct file name etc.)
  * IE7: works as expected (opens the File Download dialog with the correct file name etc.)
  * FF2: does not work (a # char is append to the URL but otherwise nothing
happens)

formsplayer (1.6.1030dev):
  * IE6: works as expected (opens the File Download dialog with the correct file name etc.)
  * IE7: works as expected (opens the File Download dialog with the correct file name etc.)

Orbeon Forms (nightly build):
  * IE6: works as expected (opens the File Download dialog with the correct file name etc.)
  * IE7: does not work (a new window is opened but it disappears
immediately)
  * FF2: works as expected (opens the File Download dialog with the correct file name etc.)


As you can see from the test results, Orbeon Forms works with IE6 and FF2 but not with IE7. XSLTForms and formsPlayer (plug-in), however, work with IE7.

Today, I finally figured out a good workaround for this issue when using Orbeon Forms as an XForms implementation - AVTs!
http://www.orbeon.com/ops/doc/reference-xforms-extensions#avts-xhtml

Instead of using the following syntax for the download link:
<xforms:trigger appearance="minimal">
   <xforms:label>Download file</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:load ref="instance( 'download-url-instance' )" show="new" />
   </xforms:action>
</xforms:trigger>

I am now using this syntax for the download link:
<a href="{instance( 'download-url-instance' )}" target="_blank">Download file</a>

It works great with all the aforementioned browsers (IE6, IE7, and FF2).
The only downside of this solution is that the syntax is not XForms 1.1 compliant (contains Orbeon Forms extensions).

What I still don't quite understand is that howcome <xforms:load resource="..." show="new" /> syntax does not work with IE7 in Orbeon Forms? The service which serves files seems to be working well as well as the syntax for downloading files with IE6 & FF2 in Orbeon Forms and with
IE7 in XSLTForms.

Thanks for all the help, Alex. I really appreciate it!!!

Regards


-Markku

On Fri, 20 Mar 2009, Ryan Puddephatt wrote:

> Alex,
>   You could set the content type to application/octet-stream that will
> force all browsers to do a download. That's how I've got around it in
> the past
>
> Thanks
>
> Ryan
> -----------------------------------------------
> Ryan Puddephatt
> Connectivity Developer
> Fidessa LatentZero
> 1 Old Jewry
> London EC2R 8DN
> Office: +44 (0) 20 7105 1000
> Direct: +44 (0) 20 7105 1821
> Blackberry: +44 (0) 79 8539 2458
> Fax: +44 (0) 20 7105 1818
> Email: [hidden email]
> Web: http://www.latentzero.com
>
>
> ----- Original Message -----
> From: Alessandro  Vernet <[hidden email]>
> To: [hidden email] <[hidden email]>
> Sent: Thu Mar 19 23:40:01 2009
> Subject: [ops-users] Re: Re: Re: File Download (XForms & IE7)
>
>
> Markku,
>
>
> Markku Laine wrote:
>>
>> Thanks for the tip. Actually, I have already tried xxforms:download
>> before but as you said it has some limitations:
>>   * It's an Orbeon Forms XForms extension (not standard XForms)
>>   * It does not work when cookies are disabled by the browser
>>   * In IE7, it opens (replaces the current content of the Web page),
>> for example, a downloaded image to the browser i.e. displays it
>> instead of showing the File Download dialog
>>   * It works with a clickable link only
>>
>
> Given the way browsers work, we can't do much about this, except your
> 3rd item above. I also noticed that behavior with IE7 (as well as
> Safari and Opera, so Firefox seems to be the exception here). Did you
> see anything that is missing in the headers we send to the browser for
> IE7 to ask the user to download the file instead of showing it?
>
>
> Markku Laine wrote:
>>
>> I have already created my own service which serves files, just like
>> xxforms:download, and it works well except with IE7. For this reason,
>> I would like to ask, could it be possible for Orbeon Forms to support
>> the show="new" attribute of the xforms:load element? Or is this even
>> technically possible to implement?
>>
>
> <xforms:load show="new"> is already supported. You can find an example
> in the action-load.xhtml sandbox example
> (http://localhost:8080/orbeon/xforms-sandbox/sample/action-load).
>
> Alex
>
> -----
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's
> Blog: http://www.orbeon.com/blog/ Personal Blog:
> http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet
> --
> View this message in context:
> http://www.nabble.com/File-Download-%28XForms---IE7%29-tp21814039p2261
> 1712.html Sent from the ObjectWeb OPS - Users mailing list archive at
> Nabble.com.
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
>
> ______________________________________________________________________
> _ The information transmitted is intended only for the person or
> entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by Verizon Business Internet
> Managed Scanning Services - powered by MessageLabs. For further
> information visit http://www.mci.com
>
--
Markku Laine <[hidden email]>, Research assistant Helsinki University of Technology Department of Media Technology P.O. BOX 5400, FI-02015 HUT, FINLAND Mobile. +358-50-565 8179


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

_______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: Re: Re: Re: Re: File Download (XForms & IE7)

Markku Laine
Ryan,


Okay, I have only used Orbeon Forms as an XForms Engine in my Web  
applications and haven't used XPL at all.

Regards


-Markku

On 20.3.2009, at 13.07, Ryan Puddephatt wrote:

> Markku,
>   I actually used the HTTP Serializer processor to do it in an XPL
>
> http://www.orbeon.com/ops/doc/processors-serializers-http
>
> I had to set content-type and force-content-type to true....is it  
> possible your not forcing the content type? Or that you could change  
> your server to pass these url requests through an XPL that does this?
>
> Thanks
>
> Ryan
> -----------------------------------------------
> Ryan Puddephatt
> Connectivity Developer
> Fidessa LatentZero
> 1 Old Jewry
> London EC2R 8DN
> Office: +44 (0) 20 7105 1000
> Direct: +44 (0) 20 7105 1821
> Blackberry: +44 (0) 79 8539 2458
> Fax: +44 (0) 20 7105 1818
> Email: [hidden email]
> Web: http://www.latentzero.com
>
>
> -----Original Message-----
> From: .::: Markku :::. [mailto:[hidden email]]
> Sent: 20 March 2009 10:43
> To: [hidden email]
> Subject: [ops-users] Re: Re: Re: Re: Re: File Download (XForms & IE7)
>
> Ryan,
>
>
> Thanks for the tip! I gave it a try by doing the following  
> modifications to my response handler:
> BEFORE:
> ...
> response.setContentType( contentType );
> response.addHeader( "Content-Disposition", "attachment; filename=" +  
> fileName ); ...
>
> NOW:
> ...
> response.setContentType( "application/octet-stream" ); //
> response.addHeader( "Content-Disposition", "attachment; filename=" +  
> fileName ); // REMOVED ...
>
> Unfortunately, this did not help for me :( When I tried to download,  
> for example, a JPEG image, I got the following responses from  
> different
> browsers:
>  * IE6: Opened/embedded the image to a new window
>  * IE7: Opened/embedded the image to a new window
>  * FF2: Opened the File Download dialog but the name of the file is  
> the same as the download URL's file name (not the name of the file  
> to be
> downloaded)
>
> I used the following syntax for the download link:
> <xforms:trigger appearance="minimal">
>   <xforms:label>Download file</xforms:label>
>   <xforms:action ev:event="DOMActivate">
>     <xforms:load ref="instance( 'download-url-instance' )"  
> show="new" />
>   </xforms:action>
> </xforms:trigger>
>
> Ryan, am I doing this right? If the workaround works for you with  
> all browsers could it be possible that you could share a simple web  
> application which demonstrates how this should be done correctly?
>
> Alex, I tested my download link (the one above)/Web page combined  
> with my service which serves files with different XForms  
> implementations (without Ryan's modification) and got the following  
> results:
> Chiba (web 3.0.0b1):
>  * IE6: does not work (opens a warning window with the text: "Session
> Error")
>  * IE7: does not work (a new window is opened but it disappears
> immediately)
>  * FF2: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>
> XSLTForms (beta 2009-02-03):
>  * IE6: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>  * IE7: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>  * FF2: does not work (a # char is append to the URL but otherwise  
> nothing
> happens)
>
> formsplayer (1.6.1030dev):
>  * IE6: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>  * IE7: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>
> Orbeon Forms (nightly build):
>  * IE6: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>  * IE7: does not work (a new window is opened but it disappears
> immediately)
>  * FF2: works as expected (opens the File Download dialog with the  
> correct file name etc.)
>
>
> As you can see from the test results, Orbeon Forms works with IE6  
> and FF2 but not with IE7. XSLTForms and formsPlayer (plug-in),  
> however, work with IE7.
>
> Today, I finally figured out a good workaround for this issue when  
> using Orbeon Forms as an XForms implementation - AVTs!
> http://www.orbeon.com/ops/doc/reference-xforms-extensions#avts-xhtml
>
> Instead of using the following syntax for the download link:
> <xforms:trigger appearance="minimal">
>   <xforms:label>Download file</xforms:label>
>   <xforms:action ev:event="DOMActivate">
>     <xforms:load ref="instance( 'download-url-instance' )"  
> show="new" />
>   </xforms:action>
> </xforms:trigger>
>
> I am now using this syntax for the download link:
> <a href="{instance( 'download-url-instance' )}"  
> target="_blank">Download file</a>
>
> It works great with all the aforementioned browsers (IE6, IE7, and  
> FF2).
> The only downside of this solution is that the syntax is not XForms  
> 1.1 compliant (contains Orbeon Forms extensions).
>
> What I still don't quite understand is that howcome <xforms:load  
> resource="..." show="new" /> syntax does not work with IE7 in Orbeon  
> Forms? The service which serves files seems to be working well as  
> well as the syntax for downloading files with IE6 & FF2 in Orbeon  
> Forms and with
> IE7 in XSLTForms.
>
> Thanks for all the help, Alex. I really appreciate it!!!
>
> Regards
>
>
> -Markku
>
> On Fri, 20 Mar 2009, Ryan Puddephatt wrote:
>
>> Alex,
>>  You could set the content type to application/octet-stream that will
>> force all browsers to do a download. That's how I've got around it in
>> the past
>>
>> Thanks
>>
>> Ryan
>> -----------------------------------------------
>> Ryan Puddephatt
>> Connectivity Developer
>> Fidessa LatentZero
>> 1 Old Jewry
>> London EC2R 8DN
>> Office: +44 (0) 20 7105 1000
>> Direct: +44 (0) 20 7105 1821
>> Blackberry: +44 (0) 79 8539 2458
>> Fax: +44 (0) 20 7105 1818
>> Email: [hidden email]
>> Web: http://www.latentzero.com
>>
>>
>> ----- Original Message -----
>> From: Alessandro  Vernet <[hidden email]>
>> To: [hidden email] <[hidden email]>
>> Sent: Thu Mar 19 23:40:01 2009
>> Subject: [ops-users] Re: Re: Re: File Download (XForms & IE7)
>>
>>
>> Markku,
>>
>>
>> Markku Laine wrote:
>>>
>>> Thanks for the tip. Actually, I have already tried xxforms:download
>>> before but as you said it has some limitations:
>>>  * It's an Orbeon Forms XForms extension (not standard XForms)
>>>  * It does not work when cookies are disabled by the browser
>>>  * In IE7, it opens (replaces the current content of the Web page),
>>> for example, a downloaded image to the browser i.e. displays it
>>> instead of showing the File Download dialog
>>>  * It works with a clickable link only
>>>
>>
>> Given the way browsers work, we can't do much about this, except your
>> 3rd item above. I also noticed that behavior with IE7 (as well as
>> Safari and Opera, so Firefox seems to be the exception here). Did you
>> see anything that is missing in the headers we send to the browser  
>> for
>> IE7 to ask the user to download the file instead of showing it?
>>
>>
>> Markku Laine wrote:
>>>
>>> I have already created my own service which serves files, just like
>>> xxforms:download, and it works well except with IE7. For this  
>>> reason,
>>> I would like to ask, could it be possible for Orbeon Forms to  
>>> support
>>> the show="new" attribute of the xforms:load element? Or is this even
>>> technically possible to implement?
>>>
>>
>> <xforms:load show="new"> is already supported. You can find an  
>> example
>> in the action-load.xhtml sandbox example
>> (http://localhost:8080/orbeon/xforms-sandbox/sample/action-load).
>>
>> Alex
>>
>> -----
>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise  
>> Orbeon's
>> Blog: http://www.orbeon.com/blog/ Personal Blog:
>> http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet
>> --
>> View this message in context:
>> http://www.nabble.com/File-Download-%28XForms---IE7%29- 
>> tp21814039p2261
>> 1712.html Sent from the ObjectWeb OPS - Users mailing list archive at
>> Nabble.com.
>>
>>
>>
>> ______________________________________________________________________
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> ______________________________________________________________________
>>
>> ______________________________________________________________________
>> _ The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or  
>> privileged material. Any review, retransmission, dissemination or  
>> other use of, or taking of any action in reliance upon, this  
>> information by persons or entities other than the intended  
>> recipient is prohibited. If you received this in error, please  
>> contact the sender and delete the material from any computer.
>>
>> _____________________________________________________________________
>> This e-mail has been scanned for viruses by Verizon Business Internet
>> Managed Scanning Services - powered by MessageLabs. For further
>> information visit http://www.mci.com
>>
>
> --
> Markku Laine <[hidden email]>, Research assistant Helsinki  
> University of Technology Department of Media Technology P.O. BOX  
> 5400, FI-02015 HUT, FINLAND Mobile. +358-50-565 8179
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
>
> _______________________________________________________________________
> The information transmitted is intended only for the person or  
> entity to which it is addressed and may contain confidential and/or  
> privileged material. Any review, retransmission, dissemination or  
> other use of, or taking of any action in reliance upon, this  
> information by persons or entities other than the intended recipient  
> is prohibited. If you received this in error, please contact the  
> sender and delete the material from any computer.
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by Verizon Business  
> Internet Managed Scanning Services - powered by MessageLabs. For  
> further information visit http://www.mci.com
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: File Download (XForms & IE7)

Alessandro Vernet
Administrator
In reply to this post by Ryan Puddephatt-3
Ryan,

On Fri, Mar 20, 2009 at 12:39 AM, Ryan Puddephatt
<[hidden email]> wrote:
>   You could set the content type to application/octet-stream that will force all browsers to do a download. That's how I've got around it in the past

This is interesting! I'll have to try it out. I was hoping that
setting the Content-Disposition to attachment would be good enough to
tell the browser that this is a file we want to save, but apparently
not.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws