This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "HTTP Response Handling Library"
From OWASP
(Created page with "<h4>Introduction</h4> Secure PHP Static HTTP Response Handling Library is to control the downloadable contents in the library. With control we mean the download speed with whi...") |
|||
Line 6: | Line 6: | ||
<ul> | <ul> | ||
<li> | <li> | ||
− | <b>MIME :</b>This function is used to find out the extension of | + | <b>MIME: </b>This function is used to find out the extension of files and to determine their types from their extensions. |
+ | </li> | ||
+ | <li> | ||
+ | <b>isModifiedSince: </b>This function is used to calculate if the file has changed since the user last visited that page. If the file has been changed since the last visit, then true is returned indicating the browser to re-download the file. | ||
+ | </li> | ||
+ | <li> | ||
+ | <b>calculateHTTPRange: </b>This function is used to calculate which parts of file have been downloaded and which parts have NOT been downloaded. With this knowledge, the browsers and the download managers can be instructed to download only the remaining parts. | ||
+ | </li> | ||
+ | <li> | ||
+ | <b>download: </b>This function is used to download a file. This function is the central function that uses all of the above functions and many others to impose limits on the file download speed and to serve only those parts of file which needs to be downloaded. This function also rewrites the HTTP headers for indicating the browsers about the details of the content it is serving. | ||
+ | </li> | ||
+ | <li> | ||
+ | <b>serveData: </b>This function is used to serve some data to the client. This is different from serving a file. There is no limit nor restrictions on the download of this chunk of data. This chunk of data is served as a whole and not in parts. | ||
</li> | </li> | ||
</ul> | </ul> | ||
+ | <BR> | ||
+ | <h4>Other Helpful Links</h4> |
Latest revision as of 07:30, 26 July 2013
Introduction
Secure PHP Static HTTP Response Handling Library is to control the downloadable contents in the library. With control we mean the download speed with which the files are served to the users. Developers can use this library to set a speed limit on the files. This library also contains functions to resume download which is supported in most of the browsers and assists download managers.
Functions in this library
Lists of functions in this library and their uses are as follows:
- MIME: This function is used to find out the extension of files and to determine their types from their extensions.
- isModifiedSince: This function is used to calculate if the file has changed since the user last visited that page. If the file has been changed since the last visit, then true is returned indicating the browser to re-download the file.
- calculateHTTPRange: This function is used to calculate which parts of file have been downloaded and which parts have NOT been downloaded. With this knowledge, the browsers and the download managers can be instructed to download only the remaining parts.
- download: This function is used to download a file. This function is the central function that uses all of the above functions and many others to impose limits on the file download speed and to serve only those parts of file which needs to be downloaded. This function also rewrites the HTTP headers for indicating the browsers about the details of the content it is serving.
- serveData: This function is used to serve some data to the client. This is different from serving a file. There is no limit nor restrictions on the download of this chunk of data. This chunk of data is served as a whole and not in parts.