I am able to upload a file to AWS S3.
But, lets say I have uploaded a file to my bucket with the key: myfolder\filename.pdf,
It doesn't create the folder myfolder, and the name of the new file in S3 (also when downloaded) is myfolder_filename.pdf (it replaces backslash with underscore).
My questions are:
1. How can I determine the downloaded file's name?
2. How can I tell AWS that I want it to create new folder? maybe than the downloaded filename will be just filename.pdf.
Maybe the problem is that I used backslash and not frontslash? (i used path.join)
Thanks!
Ideally you have to send the "folder/filename" for the "Key" property in AWS sdk S3 call. S3 will create the folder if it doesn't exist based on the key you are sending.
You have to pass the key as "myfolder/filename.pdf" . The slash should be "/"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With