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.

  • What have you tried? 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. Commented Mar 3, 2022 at 6:47

1 Answer 1


The 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)

Before the patch for supporting RML plugin

After the patch After the patch for supporting RML plugin

  • 3
    Hello Sri and thank you for providing an answer to your problem. Please don't post blocks of code as images - instead use the correct code formatting tool - Editing / Formatting help
    – Bysander
    Commented Apr 7, 2022 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.