onCompleted function does not receive actual uploaded file name

Issue #4 new
Samuel Liew created an issue

When there is another file on the server with same name, ValumsFileUploader appends digits after the file name. This value is passed on to the target [receptorClassName]/[methodName], however, it is not passed back to CocoWidget's onCompleted method.

$this->widget('CocoWidget', 
   array(
      ...,

      'onCompleted' => 'function(id, filename, jsoninfo) {
         // wrong filename if there is duplicate on server!
         console.log(filename);
      }
   )
}

Comments (5)

  1. Cristian Salazar repo owner

    helo Samuel ! ok. i'll review it tomorrow with a fresh brain ! thanks for report it.

  2. Samuel Liew reporter

    Temporary workaround:

    'onCompleted' => 'function(id, filename, jsoninfo) {
        // get the actual filename that the server returned
        filename = jsoninfo.filename + "." + jsoninfo.ext;
        console.log(filename);
    }
    
  3. Log in to comment