admin管理员组文章数量:1202371
I have installed wordpress plugins Real Media library, Real Physical Media, and Media file renamed. Using this I am able to physically move images and organize images in the upload folder as per categories. Both these plugins have API - .html .html
but they don't seem to provide any option to upload files.
It means for uploading I still need to use the classic Wordpress rest API. So how do I then physically move the files, do I upload using classic way, and the images get uploaded in the date file structure format, and use a second API call to move those uploaded images? Or directly while uploading itself I can set the destination folder.
I have installed wordpress plugins Real Media library, Real Physical Media, and Media file renamed. Using this I am able to physically move images and organize images in the upload folder as per categories. Both these plugins have API - https://docs.devowl.io/real-media-library/api/index.html https://docs.devowl.io/real-physical-media/api/index.html
but they don't seem to provide any option to upload files.
It means for uploading I still need to use the classic Wordpress rest API. So how do I then physically move the files, do I upload using classic way, and the images get uploaded in the date file structure format, and use a second API call to move those uploaded images? Or directly while uploading itself I can set the destination folder.
Share Improve this question asked Feb 26, 2022 at 6:02 Sri Nithya SharabheshwaranandaSri Nithya Sharabheshwarananda 1113 bronze badges 3- What have you tried? – Tony Djukic Commented Feb 28, 2022 at 17:40
- Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Bot Commented Feb 28, 2022 at 17:40
- @TonyDjukic - I have not even tried it yet. I had to move to another project before I could try something out. But I played with the API a bit, it looks like I need to upload like any other ordinary file, and then move it to the specific folder using the WP plugins I mentioned. I just wanted to know if the WP API directly had something which I might not be aware of. – Sri Nithya Sharabheshwarananda Commented Mar 3, 2022 at 6:47
1 Answer
Reset to default 0The problem is solved.
Actually in the regular Wordpress API for uploading media
wp/v2/media
please add one more form data entry rmlFolder: <the_id_of_destination_folder>
That is all, it gets uploaded in the correct folder.
I am posting my code (in Java based on a library not written by me)
After the patch
本文标签: media libraryHow to upload images in a specific folder using API
版权声明:本文标题:media library - How to upload images in a specific folder using API 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738646985a2104645.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论