cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jain, Neeraj" <neeraj.j...@wincor-nixdorf.com>
Subject RE: specifying filename in map:read
Date Mon, 25 Oct 2004 09:15:21 GMT
Thank you for reply. I am sure that the file is not empty. Also the space
between "content-" and disposition does not do any good, unfortunately.
 

-----Original Message-----
From: Gunter D'Hondt [mailto:gunter.dhondt@sofico.be] 
Sent: Monday, October 25, 2004 4:42 PM
To: users@cocoon.apache.org
Subject: RE: specifying filename in map:read



are you sure the file isn't empty? 


the big problem with file downloads is how to make it work in IE becourse IE
doesn't use the standard way like Mozilla, NS, ... try placing a space
between "content-" and "disposition" 


the [1] is something typical for IE 


Gunter 







"Jain, Neeraj" <neeraj.jain@wincor-nixdorf.com> 


25-10-2004 03:13 


Please respond to
users@cocoon.apache.org



To
"'users@cocoon.apache.org'" <users@cocoon.apache.org> 

cc

Subject
RE: specifying filename in map:read

	




As I updated in my previous mail that the solution suugested by Gunter
worked fine to specify the file name. 
    response.setHeader("Content-Disposition", "attachment;
filename=myfile.txt;"); 
I ran into another problem after modifying the header. I am not sure if that
is a problem with browser, or I need to set another attribute in the header.
Following is the error. 
  
    1. When I click the Download button on the html page, it displays the
"File Download" dialog box with the filename specified in the
"content-Disposition" header. 
  
    2. However when I click the "Open" button on the file download box, I
get another dialog box, "Windows cannot open this file ........". Then I
select "Select the program from a list" option and click "Ok" and then I
select "notepad" from the "Open With" dialog box. 
    3. After this it opens the notepad application, and displays another
dialog box with following question" 
    "Cannot find the D:\Data\...............\Temporary Internet
Files\Content.IE5\8AFR0TYJ\myfile[1].txt. Do you want to create a new file?"

  
    I click the "yes" button and but still it does not download the file
correctly. Also I am not sure why the filename gets manipulated with "[1]"
text. 
    Is there any setting in Ineternet Explorer to rectify this problem or
there is something wrong with my program? 
  
    THE SAME THING WORKS WELL IN MOZILLA, i.e., FILE GETS DOWNLOAD PROPERLY
WITH DESIRED FILE NAME. 
  
    Could someone please suggest on as to what could be wrong with my
program. 
  
    Thank you for your help. 
  
  
  
  
-----Original Message-----
From: Gunter D'Hondt [mailto:gunter.dhondt@sofico.be] 
Sent: Friday, October 22, 2004 2:50 PM
To: users@cocoon.apache.org
Subject: Re: specifying filename in map:read


you should set the http header content-disposition; I don't know exactly if
that can be easily set in the sitemap but if that doesn't work you can
easily define an action that does it: 

response.setHeader("Content-Disposition", "attachment;
filename=yourfile.extension;"); 

sometimes it also necessary to place a space between "content-" and
"disposition" 


Gunter 






"Jain, Neeraj" <neeraj.jain@wincor-nixdorf.com> 


22-10-2004 06:33 



Please respond to
users@cocoon.apache.org




To
"'users@cocoon.apache.org'" <users@cocoon.apache.org> 

cc

Subject
specifying filename in map:read


	





Hi, 
   I am trying to download a file from server and I have following entry in
the sitemap for the same. 
 
 <map:match pattern="myURI*">
     <map:act type="myURI-action">
         <map:read src="{filename}" mime-type="application/dbexport"/>
         <map:redirect-to uri="{result}"/>
     </map:act>
     <map:redirect-to uri="cocoon:/main.html?title=error+in+myURI-action"/>
</map:match> 
 
Now, I am able to get the file correctly but the "File Name" field in the
file download dialog is a random text. Is there is way to specify this field
from my myURI-action class? 
Also the "Type" field is blank in the File Download dialog box. Can someone
please tell me how can I specify the filename here. 
 
Thanks. 



Mime
View raw message