S3 Put File



    David 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
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.