Table of Contents
StatusDraft
TodoProof read

Download Helper

The download helper assists in forcing downloading of files by presenting users with the “save as” dialog.

Methods

force()

'force' forces a download of a file to the user's browser. This function is binary-safe and will work with any MIME type that Kohana is aware of.

Example:

// File path is relative to the front controller
download::force("file.txt");
 
// For a file located in application/downloads
 
// Use relative path
download::force('./application/downloads/file.txt');
 
// OR use the defined application path
download::force(APPPATH.'downloads/file.txt');
helpers/download.txt · Last modified: 2008/05/01 20:31 (external edit)