FileUpload

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.

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.

FileUpload

Adds a file in a folder. It generates a POST

Sample Request

Upload a file in the root directory of the resource type “Files”.

connector.php?command=FileUpload&type=Files&currentFolder=%2F

The request will be done using POST (instead of GET) and the data will encoded in “multipart/form-data”. Only one field will be posted, named “NewFile”, containing the file uploaded data.

Sample Response

<script type="text/javascript">
 window.parent.OnUploadCompleted( 0, '' ) ;
</script>


This command doesn’t expect XML to be returned. Actually HTML must return with a <script> tag. The content type must be “text/html”. The "OnUploadCompleted" is a JavaScript function that is called to expose the upload result.

The possible values are:

  • OnUploadCompleted( 0 ) : no errors found on the upload process.
  • OnUploadCompleted( 1, 'Reason' ) : the upload filed because of "Reason".
  • OnUploadCompleted( 201, 'FileName(1).ext' ) : the file has been uploaded successfully, but its name has been changed to "FileName(1).ext".
  • OnUploadCompleted( 202 ) : invalid file.

Note that uploaded file names may contain non ASC-II chars.

This page was last edited on 28 May 2010, at 08:46.