                 params: Bucket: awsS3.bucket
             )
 
-            filename = "#{ awsS3.destFolder }/#{ filename }" if awsS3.destFolder
+            filename = "#{ destFolder }/#{ filename }" if destFolder
 
             fileParams =
                 Key: filename

            @_disabled = false
            @_createInput()


        _setDestFolder: (destFolder) =>
            @awscredentials.destFolder = destFolder


        _uploadS3: (file, filename) ->
            defer = $q.defer()
            awsS3 = @awscredentials



            return defer.promise

        _uploadWorker: ({ file, filename }) ->
            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'
