DownloadFile"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(New page: == 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”. <pre>con...)
(No difference)

Revision as of 14:53, 16 January 2008

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' ) ;