CORS error tryouts.

This commit is contained in:
Naida Vatric
2020-02-18 23:49:00 +01:00
parent c11248e100
commit b13b4bc7c2
3 changed files with 20 additions and 9 deletions

View File

@@ -58,10 +58,10 @@
function uploadFile(file) {
$("#status").html('Starting Upload...')
url = c;
fetch(url, {
fetch(url, {
method: 'PUT',
headers: {
"content-type": "image/png"
"content-type": "image/*"
},
mode: 'cors',
body: file
@@ -75,5 +75,6 @@
.catch(error => $("#status").html(error)
)
.then(response => $("#status").html('File uploaded successfully: ' + filename + 'Response:' + response.text()));
}
</script>