         fileData(scope,attributes)
 
     controller: ($scope, $element, $http, $timeout) ->
+      callback = ->
+        $element[0].attributes['ng-callback'].value if $element[0].attributes['ng-callback']
       $scope.uploadFiles = (model,id,file,parent) ->
-        uploadFiles($scope,$element,model,id,file,parent,$timeout)
+        uploadFiles($scope,$element,model,id,file,parent,$timeout,callback())
       $scope.progress = 0
       $scope.uploadProgress = ->
         return $scope.progress

            return true if option.indexOf('true') > -1
        return false
      $scope.uploadFiles = (model,id,file,parent) ->
        uploadFiles($scope,$element,model,id,file,parent,$timeout)

        return attributes.accept if attributes.accept
        return '*'
    controller: ($scope, $element, $http, $timeout) ->
      callback = ->
        $element[0].attributes['ng-callback'].value if $element[0].attributes['ng-callback']
      $scope.show = (type) ->
        options = $element[0].attributes['ng-upload-options'].value.replace('{','').replace('}','').split(',')
        for option in options
