Is there a way to get a notification via PHP, or Javascript when a user Uploads a new file?
I would like to get the name of the new file uploaded and save it to a database, while also keeping track of the # of files that were uploaded.
I would like to get the name of the new file uploaded and save it to a database, while also keeping track of the # of files that were uploaded.

Re: Attaching Upload Function to a Callback
-- File Upload - To Run custom code when a file is uploaded
open up the file:
/ckfinder/core/connector/php/php5/CommandHandler/FileUpload.php
if you want something to happen when a file uploads without a problem, look for the switch statement and add it within the case "UPLOAD_ERR_OK"
switch ($uploadedFile['error']) { case UPLOAD_ERR_OK: // My Code if($_GET['type']=="Videos" || $_GET['type']=="Flash" ) { // Run Custom Code } break;I wanted to prevent users from uploading files, to limit the # of uploaded files they can have.
So within FileUpload.php just before the switch statement I added the following, which when evaluates to
true it will throw an error, and ckfinder will stop processing the upload:
// My Code if(checkCreditsAvailable()) { $this->_errorHandler->throwError(CKFINDER_OUT_OF_CREDITS); }-- Delete File custom code
open up the file:
/ckfinder/core/connector/php/php5/CommandHandler/DeleteFile.php
within the last if statement, where the bDeleted statement will be true add your code:
if ($bDeleted) { if($_GET['type']=="Videos" || $_GET['type']=="Flash" ) { // run some more custom code, when a file is deleted the # of files they can upload will increase } }I also set up the custom error message here:
-- To Create a Custom Error Message
open up the file:
ckfinder/core/connector/php/lang/en.php
Add an error to the array
open up the file:
ckfinder/core/connector/php/constants.php
Add a global constant and match it to the # '987' of whatever you used in the step above.
define('CKFINDER_OUT_OF_CREDITS',987);Re: Attaching Upload Function to a Callback
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+