We have introduced a setting in the dspace.cfg that will be available  
in dspace 1.5 and also 1.4.x branch (so it might be available if we  
do decide to do a 1.4.3 release). It is only in the JSPUI at the  
moment and allows for the control of the disposition header on  
Bitstreams being downloaded, it will inform the browser to switch to  
treating the bitstream as a download to the file system vs. opening  
it in the plugin or application.

the parameter in dspace.cfg would be:

webui.content_disposition_threshold=<size-in-bytes>

I you have experience with working in the source

>   /**
>      * Threshold on Bitstream size before content-disposition will  
> be set.
>      */
>     private int threshold  = ConfigurationManager
>                 .getIntProperty 
> ("webui.content_disposition_threshold");

... in method ...

> protected void doDSGet(Context context, HttpServletRequest request,
>             HttpServletResponse response) throws ServletException,  
> IOException,
>             SQLException, AuthorizeException
...

> // Response length
>         response.setHeader("Content-Length", String
>                 .valueOf(bitstream.getSize()));
>
>         if(threshold != -1 && bitstream.getSize() >= threshold)
>         {
>             setBitstreamDisposition(bitstream.getName(), request,  
> response);
>         }

later in the class...

...

>     /**
>      * Evaluate filename and client and encode appropriate disposition
>      *
>      * @param uri
>      * @param request
>      * @param response
>      * @throws UnsupportedEncodingException
>      */
>     private void setBitstreamDisposition(String filename,  
> HttpServletRequest request,
>             HttpServletResponse response)
>     {
>
>         String name = filename;
>
>         Matcher m = p.matcher(name);
>
>         if (m.find() && !m.group().equals(""))
>         {
>             name = m.group();
>         }
>
>         try
>         {
>             String agent = request.getHeader("USER-AGENT");
>
>             if (null != agent && -1 != agent.indexOf("MSIE"))
>             {
>                 name = URLEncoder.encode(name, "UTF8");
>             }
>             else if (null != agent && -1 != agent.indexOf("Mozilla"))
>             {
>                 name = MimeUtility.encodeText(name, "UTF8", "B");
>             }
>
>         }
>         catch (UnsupportedEncodingException e)
>         {
>             log.error(e.getMessage(),e);
>         }
>         finally
>         {
>             response.setHeader("Content-Disposition",  
> "attachment;filename=" + name);
>         }
>
>
>     }



-Mark

On Sep 20, 2007, at 11:45 PM, Girija S wrote:

> Dear Rune Pettersen,
>
> We have that problem with some pdf files and in some computers.   
> Sometimes
> the file opens in IE explorer but not in firefox or mozilla in the  
> same
> computer!  One way to solve this is to set the browser preferences  
> to open
> the file with the acrobat reader and not the plugin.  Then the  
> files open


> without any problem.
>
> But this has to be done individually by the user at his end.  I  
> don't know
> if this is the right solution.
>
> Best wishes,
> Girija Srinivasan
>
> ---------------------------------------------------------------------- 
> ---------
>   Girija Srinivasan,
>   Raman Research Institute Library,               Tel:  +91 80 2361  
> 0122
>   C V Raman Avenue, Sadashivanagar,               Fax:  +91 80 2361  
> 0492
>   Bangalore 560 080, India.                       Email:  
> [EMAIL PROTECTED]
>
> On Thu, 20 Sep 2007, Rune Pettersen wrote:
>
>> The way pdf is opened depends on adobe-reader and the browser,
>> not on the server.
>> The setting can be adjusted per browser I believe. Reinstall the  
>> reader
>> if in doubt.
>>
>> Den 20.09.2007 14:13, James Rutherford skrev:
>>
>>  What exactly is the problem? The pdf opens in my browser just  
>> fine in
>> Opera 9 & Firefox 2 on linux.
>>
>> cheers,
>>
>> Jim
>>
>> On Thu, Sep 20, 2007 at 12:57:43PM +0300, Mika Stenberg wrote:
>>
>>
>>  Hi,
>>
>> We are experiencing increasing difficulties in opening pdf- files via
>> Dspace / Manakin.  This is beginning to look like a serious problem
>> which affects the overall usability of the software. The problem  
>> exists
>> both in Manakin UI and Dspace UI.
>>
>> If someone has any suggestions how to make pdf files open in browser,
>> please let me know.
>>
>> You can see a demo of such problem at:
>> http://hdl.handle.net/2455/131898
>>
>> Thanks,
>> Mika
>>
>> -- 
>> Mika Stenberg
>> IT-asiantuntija
>>
>> Terveystieteiden Keskuskirjasto
>> LACURACURketieteellinen tdk
>> PL 61 (Haartmaninkatu 4)
>> Helsingin Yliopisto
>> 00290 Helsinki
>>
>> puh. +358-9-191 26807
>>
>> --------------------------------------------------------------------- 
>> ----
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> DSpace-tech mailing list
>> DSpace-tech@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>
>>
>>
>>  --
>>
>> Vennlig hilsen
>> Rune Pettersen
>>
>> ***************************************
>>    Hogskolen i Telemark
>>    Hallvard Eikas plass
>>    3800 Bo
>>    Tlf.: 35 95 25 33 / 35 95 25 00
>>    [EMAIL PROTECTED]
>> http://home.hit.no/~petterse/historier/
>> ***************************************
>>
>>
>>
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> DSpace-tech mailing list
> DSpace-tech@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

~~~~~~~~~~~~~
Mark R. Diggory - DSpace Systems Manager
MIT Libraries, Systems and Technology Services
Massachusetts Institute of Technology
Office: E25-131
Phone: (617) 253-1096



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to