                     destFolder: _ctrl.destFolder
                     uploadUrl: _ctrl.uploadUrl or @uploadUrl
                     uploadMethod: _ctrl.uploadMethod or @uploadMethod
+                    signedUrl: _ctrl.signedUrl
                 )
 
             if @onBeforeUpload
                 promise = @onBeforeUpload(_ctrl)
-                if promise.then?
+                if promise?.then?
                     promise.then(_doUpload)
                 else _doUpload()
             else _doUpload()

            _ctrl =
                filename: _filename
                originalFilename: _originalFilename
                setDestFolder: (destFolder) -> _ctrl.destFolder = destFolder
                setFileName: (filename) -> _ctrl.filename = filename
                setUploadUrl: (uploadUrl) -> _ctrl.uploadUrl = uploadUrl
                setUploadMethod: (uploadMethod) -> _ctrl.uploadMethod = uploadMethod

            _doUpload = =>
                @_upload(

            name = name.replace /[^a-zA-Z-_.0-9]/g, '_'
            _prefixRand = "#{ Math.floor(Math.random() * 10000) }-#{ Date.now() }"
            return "#{ _prefixRand }-#{ name }"

        _upload: ({ file, filename, destFolder, uploadUrl, uploadMethod, signedUrl }) ->
            @_disabled = true

            func = if @awscredentials or signedUrl then '_uploadS3' else '_uploadWorker'
            this[func]({
                file
                filename
                destFolder
                uploadUrl
                uploadMethod
                signedUrl
            }).then(
                (data) => @_loadHandler(data) # success
                (err) => @_errorHandler(err) # error
