             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 }) ->
+
+        _upload: ({ file, filename, destFolder, uploadUrl, uploadMethod, signedUrl }) ->
             @_disabled = true
 
-            func = if @awscredentials then '_uploadS3' else '_uploadWorker'
+            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

            _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(


            return defer.promise

        _uploadWorker: ({ file, filename, uploadUrl, uploadMethod, destFolder }) ->
            defer = $q.defer()
            script = document.querySelectorAll('[src*="cg-file-upload.js"]')[0]
            workerUrl = new URL script.src.replace 'file-upload.js', 'file-upload-worker.js'
