Attaching already existing files from S3 #2103
Answered
by
jewishmoses
jewishmoses
asked this question in
Q&A
-
How should I attach already existing files from s3? I only want to attach the files without moving any files I tried the following: $post->addMediaFromDisk("/path/to/flie", 's3')->toMediaCollection('default', 's3'); but this moves the file into a new directory, I want to keep the original directory. My files structure on s3 are like this:
|
Beta Was this translation helpful? Give feedback.
Answered by
jewishmoses
Oct 9, 2020
Replies: 1 comment
-
I have ended up using public function getPath(Media $media): string
{
return $media->model->uuid . '/';
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
freekmurze
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have ended up using
Media::create(...)
with a foreach loop on the files and used a custom path