This component is not relevant for Windows and IBM i Servers.
The Zend Download Server (ZDS) can be used to increase your Apache Web server's capacity by automatically taking over static downloads. This releases Apache processes to handle more dynamic requests.
Files can be sent through the ZDS in two ways:
Automatically - By configuring Apache to pass specific file types to PHP: For example, images, PDF files or any other relatively large static files. When the ZDS is loaded and configured, PHP passes the request to the ZDS, which takes over sending the file to the user.
Manually - By calling the Zend Download Server API functions from within your PHP script. This is useful for situations where you require some code or logic to run before allowing a download, such as authenticating users before permitting them to download.
This procedure describes how to configure your environment to handle certain file types with the ZDS.
Although transparent to end users, this action is expected to increase server capacity.
|
|
To set up ZDS to automatically handle specific file types:
|
|
All the defined files types are now handled by the ZDS (as long as this component is set to 'On' in the Administration Interface). |
This procedure describes how to call the ZDS API functions from within your code, to handle specific types of file downloads.
Although transparent to end-users, this action is expected to increase server capacity.
The following example demonstrates the logical flow of sending a file using ZDS. In this example, the download only proceed if the user is authenticated.
Example: if ($user->isAuthenticated()) { zend_send_file($filename, $mime_types, $headers); // -- execution stops here -- } else { echo "Sorry, you are not authorized to download this file."; } |
|
If the user is not authenticated, the download does not begin and the following message is displayed: "Sorry, you are not authorized to download this file." |
|
|
|
Related Links: Components |
|
|