Upload image file to bucket success.

This commit is contained in:
Naida Vatric
2020-02-26 14:56:00 +01:00
parent b13b4bc7c2
commit bbd9dab30d
4 changed files with 18 additions and 29 deletions

View File

@@ -55,26 +55,23 @@
return false;
}
function uploadFile(file) {
function uploadFile(file) {
$("#status").html('Starting Upload...')
url = c;
fetch(url, {
method: 'PUT',
headers: {
"content-type": "image/*"
},
headers: new Headers({'content-type': 'image/*'}),
mode: 'cors',
body: file
})
.then(response => response.text())
.then (response => {
console.log(response);
return response;
}
)
.catch(error => $("#status").html(error)
)
.then(response => $("#status").html('File uploaded successfully: ' + filename + 'Response:' + response.text()));
.then(response => $("#status").html('File uploaded successfully: ' + filename ));
}
</script>