0
0
DJDavid Jozwik
The code is saying to wait for the storage object named "filePath" to be populated with the contents of the file located at "filePath" as encoded in UTF-8. The first argument is the path to the file. The second argument is an object specifying the options to the put call. The third argument is an object specifying the prefix for the private items. The fourth argument specifies the bucket where the items should be stored.
await Storage.put(`{filename}`, fs.readFileSync(filePath, { encoding: "UTF-8" }), {
customPrefix: {
public: `private/${user.sub}/${user.profileId}/${investmentId}`
},
bucket: process.env.AMPLIFY_10E_S3_BUCKET
});