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...)
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{CKFinder_SSI_Warning}}
 
== DownloadFile ==
 
== DownloadFile ==
  

Latest revision as of 07:46, 28 May 2010

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 the 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' ) ;
This page was last edited on 28 May 2010, at 07:46.