Just figured it out; add a servlet filter that alter the http header attribute 
of [code]content-disposition[/code], here is a code  snippet:

Actually I just figure out a work around; adding a servlet filter that alters 
http header attribute `content-disposition` to `attachment` and that's it!
here is a the code snippet:

[code]
    public void doFilter(ServletRequest request, ServletResponse response,
                        FilterChain chain) throws IOException, ServletException 
{
                StringBuffer fileName = new StringBuffer();
                HttpServletRequest req = (HttpServletRequest) request;
                HttpServletResponse resp = (HttpServletResponse) response;
    
                StringBuffer extension = new StringBuffer(
                                
FilenameUtils.getExtension(req.getRequestURL().toString()));
    
                log.debug("--***-- File extension : " + extension.toString());
    
                if (extension.toString().equalsIgnoreCase("pdf")
                                || 
extension.toString().equalsIgnoreCase(".pdf")) {
    
                        
fileName.append(FilenameUtils.getBaseName(req.getRequestURL()
                                        .toString()));
    
                        log.debug("--***-- PDF file name : " + 
fileName.toString());
    
                        resp.addHeader("Content-Disposition", "attachment; 
filename="
                                        + fileName);
                }
    
                chain.doFilter(request, resp);
    
                 
        }[/code]

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=256943b5-0eae-451b-b87d-a5d33cc6e9d4


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to