Upload image file to bucket success.
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user