Difference between revisions of "API:EPrints/Apache/Storage"

From EPrints Documentation
Jump to: navigation, search
(Created page with "<!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints 3.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment'...")
 
Line 6: Line 6:
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
==NAME==
 
==NAME==
EPrints::Apache::Storage - deliver file objects via mod_perl
+
EPrints::Apache::Storage - deliver file objects via <tt>mod_perl</tt>.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 17: Line 17:
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
This mod_perl handle supports the delivery of the content of [[API:EPrints/DataObj/File|EPrints::DataObj::File]] objects.
+
This mod_perl handle supports the delivery of the content of [[API:EPrints/DataObj/File|EPrints::DataObj::File]] objects.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 40: Line 40:
 
====Content-Disposition====
 
====Content-Disposition====
  
The string "inline; filename=FILENAME" where FILENAME is the '''filename''' value of the file object.
+
The string <tt>inline; filename=FILENAME</tt> where <tt>FILENAME</tt> is the <tt>filename</tt> value of the file object.
  
If the <em>download</em> CGI parameter is true disposition is changed from "inline" to "attachment", which will present a download dialog box in sane browsers.
+
If the <tt>download</tt> CGI parameter is true disposition is changed from <tt>inline</tt> to <tt>attachment</tt>, which will present a download dialog box in sane browsers.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 54: Line 54:
 
====Content-Length====
 
====Content-Length====
  
The '''filesize''' value of the file object.
+
The <tt>filesize</tt> value of the file object.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 66: Line 66:
 
====Content-MD5====
 
====Content-MD5====
  
The MD5 of the file content in base-64 encoding if the '''hash''' value is set and '''hash_type''' is 'MD5'.
+
The MD5 of the file content in base-64 encoding if the <tt>hash</tt> value is set and <tt>hash_type</tt> is <tt>MD5</tt>.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 78: Line 78:
 
====Content-Type====
 
====Content-Type====
  
The '''mime_type''' value of the file object, or "application/octet-stream" if not set.
+
The <tt>mime_type</tt> value of the file object, or <tt>application/octet-stream</tt> if not set.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 90: Line 90:
 
====ETag====
 
====ETag====
  
The '''hash''' value of the file object, if set.
+
The <tt>hash</tt> value of the file object, if set.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 102: Line 102:
 
====Expires====
 
====Expires====
  
The current time + 365 days, if the '''mtime''' value is set.
+
The current time + 365 days, if the <tt>mtime</tt> value is set.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 114: Line 114:
 
====Last-Modified====
 
====Last-Modified====
  
The '''mtime''' of the file object, if set.
+
The <tt>mtime</tt> of the file object, if set.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 126: Line 126:
 
====Accept-Ranges====
 
====Accept-Ranges====
  
Sets Accept-Ranges to bytes.
+
Sets <tt>Accept-Ranges</tt> to bytes.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 149: Line 149:
 
====If-Modified-Since====
 
====If-Modified-Since====
  
If greater than or equal to the '''mtime''' value of the file object returns "304 Not Modified".
+
If greater than or equal to the <tt>mtime</tt> value of the file object returns <tt>304 Not Modified</tt>.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 161: Line 161:
 
====If-None-Match====
 
====If-None-Match====
  
If differs from the '''hash''' value of the file object returns "304 Not Modified".
+
If differs from the <tt>hash</tt> value of the file object returns <tt>304 Not Modified</tt>.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>

Revision as of 17:15, 15 March 2023

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Apache::Storage - deliver file objects via mod_perl.

User Comments


DESCRIPTION

This mod_perl handle supports the delivery of the content of EPrints::DataObj::File objects.

User Comments


Defined HTTP Headers

These headers will be set by this module, where possible.

User Comments


Content-Disposition

The string inline; filename=FILENAME where FILENAME is the filename value of the file object.

If the download CGI parameter is true disposition is changed from inline to attachment, which will present a download dialog box in sane browsers.

User Comments


Content-Length

The filesize value of the file object.

User Comments


Content-MD5

The MD5 of the file content in base-64 encoding if the hash value is set and hash_type is MD5.

User Comments


Content-Type

The mime_type value of the file object, or application/octet-stream if not set.

User Comments


ETag

The hash value of the file object, if set.

User Comments


Expires

The current time + 365 days, if the mtime value is set.

User Comments


Last-Modified

The mtime of the file object, if set.

User Comments


Accept-Ranges

Sets Accept-Ranges to bytes.

User Comments


Recognised HTTP Headers

The following headers are recognised by this module.

User Comments


If-Modified-Since

If greater than or equal to the mtime value of the file object returns 304 Not Modified.

User Comments


If-None-Match

If differs from the hash value of the file object returns 304 Not Modified.

User Comments


METHODS

User Comments


handler

$rc = EPrints::Apache::Storage::handler( $r )

Handler for serving document files and thumbnails.

User Comments


COPYRIGHT

© Copyright 2023 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments