FCKeditor

DownloadFile

From FCKeditor Docs

Jump to: navigation, search
Note: This information is intented for programmers interested in modifying the CKFinder core.
If you are interested in installing/configuring CFKinder, please take a look at Developer's Guide.

DownloadFile

Downloads a file from the server.

Sample Request

Download the file named “Test.jpg” from the the root directory of the resource type “Files”.

connector.php?command=DownloadFile&type=Files&currentFolder=%2F&FileName=Test.jpg

Response

This command doesn’t expect the connector to return a text response. Instead, it must stream the file data to the browser.

An important difference between a “download” stream and a normal stream, is that the “Save as” dialog will always show in the browser, instead of opening the file on it (like for .html or .jpg file). To achieve that, the “Content-Disposition” header must be set accordingly. For example, the following is the code to set the header when the “Test.jpg” file is requested (in PHP):

header( 'Content-Type: application/octet-stream' ) ;
header( 'Content-Disposition: attachment; filename=Test.jpg' ) ;
Personal tools
Powered by MediaWiki