ahmedkandel / nova-s3-multipart-upload

A Laravel Nova resource tool to upload files directly to Amazon S3. You can (upload | download | delete) single, multiple, small or big files.
MIT License
22 stars 22 forks source link

Uploading Multiple Folders #10

Closed bryanjamesmiller closed 3 years ago

bryanjamesmiller commented 3 years ago

Hi @ahmedkandel - I was wondering if you knew of a way where we can track the folder names that get uploaded. For example, if we drag and drop into the upload area 2 folders: high-resolution/ and low-resolution/ with like 100 files in each folder. We'd like to have that same file structure created on S3 so that the files stay organized, and then can be downloaded separately. I saw this thread suggest how to do this: https://github.com/transloadit/uppy/issues/2708 - any chance we can implement this or another strategy like the one descrbed here https://github.com/tus/tus-js-client/issues/144#issuecomment-467929961 (or something else) to allow for folder organization here?

bryanjamesmiller commented 3 years ago

@ahmedkandel I figured out a workaround here so no need to implement this unless you really want to 😄 thanks anyways!

ahmedkandel commented 3 years ago

Hi @bryanjamesmiller I suggest you create two instances of nova-s3-multipart-upload in your resource each instance will upload to a different path using ->path($path) method, Then the end-user can drag and drop different folders in each uploader. this is a better approach as it also keeps the files paths separated in the model.

bryanjamesmiller commented 3 years ago

Thanks @ahmedkandel we did something similar - we created a one-to-many relationship and then had a different instance of nova-s3-multipart-upload on each one! Seems obvious in retrospect 😃 but I appreciate the response!