Download

Navigation:  Development > Function Reference > Helpers > Utility >

Download

Previous pageReturn to chapter overviewNext page

Download a  file.

 

App::Utility()->download(Path, [Content Type], [File Name])

 

Parameter

Description

Path

Path of the file to download

Content Type

Content Type of the file for example "application/pdf" by default automatically set from file extension.

File Name

Download file name. By default set original file name.

 

 

See bellow example:
 
// Example 1
echo App::Utility()->download(App::Config()->baseDir("/test.pdf"));
 
// Example 2
echo App::Utility()->download(App::Config()->baseDir("/test.pdf","application/pdf","download.pdf"));