Closed cgarofalo closed 5 years ago
Hi, My package works only with local files and s3. Can you give me example, what you want. May be will do this :) If I understand correctly, you want upload files by remove url to the library?
Hi, Thanks for the quick response.
I'm using the ResourceSpace API. I can get the file paths from the API and I'm looking to save a copy of that file to the Media Library. Is that possible?
I figured something like
$media = new Media();
$media->save();
I feel like there's a way to do this?
Edit: I'm saving the files locally.
You want to do this? Media::upload($remote_url)
I think I can do it. Maybe this week or next.
Yes! That would be fantastic. Could be a $remote_url or even a $path or $file. Basically feed it a file, and it gets saved to the Media Library. Thanks a bunch!
Now, If you have $file, you can use internal existing capabilities
Post file to this route /nova-vendor/nova-media-library/upload
Package routing https://github.com/classic-o/nova-media-library/blob/master/routes/api.php Controller (upload method) https://github.com/classic-o/nova-media-library/blob/master/src/Core/Controller.php
I did see that, but I kept getting a 500 error when I tried posting to that route. I must have been doing something wrong.
Added in 0.4.0
@classic-o Thank so much! You're the best!
Hi, I am looking import media into the media manager from an API source. There doesn't seem to be any documentation on how to programatically add media. Any ideas? Thanks in advance.