Replace a file in s3 storage

@Alex T⚜️ I have a question about s3 storage.

I want to replace a file in s3 storage. I don't want to change database entries, simply send the tmp file to my bucket. I have the path and the old file information, just want to overwrite/replace it.

How can I accomplish this?

Thank you.

  • 327
  • More
Replies (4)
    • great question, am interested in that as well!

      • @Alex T⚜️ I have looked through BxDolStorage and it looks like there is no function to overwrite/replace a file already in storage. So I guess I need to extend BxDolStorage.

        I don't want to break storage routines, and I want to be sure this works properly.

        Essentially I call the storage class with my module name. I have a file on my server (tmp file) that was created by editing a file in storage already. I do not want to update all the databases for this file, I just want to send it back to the place / folder it came from.

        What is easiest solution?

        Thank you.

        • You are right, UNA always upload new one and deletes old one, if you want to just replace one file it's better to do it manually using some S3 browser, usually some S3 browser is provided by S3 provider.

          • I wanted it done in code. I hate including third party modules when UNA should have this base code built in somewhere.

            This will be done over and over, not one time. Honestly, I already had a solution, just wanted to know if I could use UNA instead of importing another third party class.

            Login or Join to comment.