Signed URL change.
This commit is contained in:
@@ -61,12 +61,20 @@ var c = "";
|
|||||||
console.log("RADIL" + file);
|
console.log("RADIL" + file);
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
"content-type": "image/png"
|
||||||
|
},
|
||||||
|
mode: 'cors',
|
||||||
body: file
|
body: file
|
||||||
})
|
})
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then (console.log())
|
.then (response => {
|
||||||
|
console.log(response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
)
|
||||||
.catch(error => $("#status").html(error)
|
.catch(error => $("#status").html(error)
|
||||||
)
|
)
|
||||||
.then(response => $("#status").html('File uploaded successfully: ' + filename));
|
.then(response => $("#status").html('File uploaded successfully: ' + filename + response.text()));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
5
index.js
5
index.js
@@ -79,7 +79,10 @@ app.get("/generateSignedURL", (req, res) => {
|
|||||||
console.log("Started server function!");
|
console.log("Started server function!");
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
version: "v2",
|
GoogleAccessID:
|
||||||
|
" kivi-original-photos-id@marketalarm.iam.gserviceaccount.com",
|
||||||
|
PrivateKey: "dd909e0aeef15920e7fc18229ce421246c143f90",
|
||||||
|
version: "v4",
|
||||||
action: "write",
|
action: "write",
|
||||||
expires: Date.now() + 86400000
|
expires: Date.now() + 86400000
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user