         xhr.addEventListener("load", uploadComplete, false)
         xhr.addEventListener("error", uploadFailed, false)
         xhr.open("POST", $gmUrls.api("issues/attachments"))
-        xhr.setRequestHeader("X-SESSION-TOKEN", $gmStorage.get('token'))
+        xhr.setRequestHeader("Authorization", "Bearer #{$gmStorage.get('token')}")
         xhr.send(formData)
         return defered.promise
 

        xhr.addEventListener("load", uploadComplete, false)
        xhr.addEventListener("error", uploadFailed, false)
        xhr.open("POST", $gmUrls.api("wiki/attachments"))
        xhr.setRequestHeader("X-SESSION-TOKEN", $gmStorage.get('token'))
        xhr.send(formData)
        return defered.promise


        xhr.addEventListener("load", uploadComplete, false)
        xhr.addEventListener("error", uploadFailed, false)
        xhr.open("POST", $gmUrls.api("tasks/attachments"))
        xhr.setRequestHeader("Authorization", "Bearer #{$gmStorage.get('token')}")
        xhr.send(formData)
        return defered.promise

