-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set destination while using uploadManyFiles in TransferManager #2492
Comments
For a temporary fix, I edited library source to ignore local paths when prefix is supplied, it works, I'd still like to know the intended way of doing so |
Hi @arnav-kr thanks for the question. The original intent was to mirror the same directory structure from local to storage. Obviously as you bumped into this can be improved. Currently nodejs-storage/src/transfer-manager.ts Lines 95 to 100 in 18eef67
We can probably add some additional options to offer a greater degree of flexibility such as not mirroring the entire path structure and only using prefix. I can take a look at making these improvements in the near future. |
Probably in options, something like a ...
destinationBuilder: (path, additionalParams) => {
let dest;
// perform operation on path
return dest;
}
... |
Thanks ❤️ |
Can you add an example code for that feature? Unit tests are not understandable for that case |
@xephtar can you please open a new issue as a feature request so we can better track it. |
I have a local directory and I want to upload its contents to cloud storage, but when using
transferManager.uploadManyFiles
with either the directory name, or array of files, the destination of the file in cloud storage is taken from the local file path.local directory structure:
here's my code
when uploaded with following code, it becomes
the prefix property works, but I want to upload files directly to
avatars/
there seem to be a
passthroughOptions
that can take a destination, but when usinguploadManyFiles
we don't know the exact file names, so can't make the full pathShouldn't it be that while using
prefix
, property, the local file path shouldn't be considered?The text was updated successfully, but these errors were encountered: