I'm looking to use this library, initially to upload files to AWS but eventually to other storage services. My spike was working until I need to get the result from uploading the file and print its Location.
I see in the S3 adapter that it uses S3's upload. That method is supposed to return an object which I can ask a Location from like this:
const data = await s3.upload(params).promise()
console.log(data.Location)
But addFileFromPath which ultimately uses that upload method, is returning void.
I understand this might've been a decision to unify the response regardless of what adapter is being used but... it would still be a good idea to allow us to access the returned object in case we need to do something with it.
In version 1.4.5 addFileFromPath, addFileFromBuffer and addFileFromReadable return the public url if the file has been added to the bucket sccessfully.
I'm looking to use this library, initially to upload files to AWS but eventually to other storage services. My spike was working until I need to get the result from uploading the file and print its Location.
I see in the S3 adapter that it uses S3's
upload
. That method is supposed to return an object which I can ask aLocation
from like this:But
addFileFromPath
which ultimately uses thatupload
method, is returningvoid
.I understand this might've been a decision to unify the response regardless of what adapter is being used but... it would still be a good idea to allow us to access the returned object in case we need to do something with it.