WordPress configure multiple upload directories for different section in

Is it possible to configure multiple upload directories in WordPress? I want to be able to use the standard WordPress media uploader but upload to different folders based on what I am uploading. As per WordPress documentation, you can set a custom uploads folder, but that will put all uploaded files to that folder.

What I need to have different pages which handle uploads differently( upload to different folders). That is, when I am on Upload page 1 I need to upload to .../uploads1/ and when I am in Upload page 2, I need to be upload to .../uploads2/.

Read More

I know you can do it using custom forms and call wp_handle_upload but want to try use the already working uploader.

Related posts

Leave a Reply

1 comment

  1. I found a hack to solve the problem. You can all update_option('uploads_use_yearmonth_folders', false); //disable default wordpress: .../uploads/year/month

    and
    update_option(‘upload_path’, ‘upload/path’); // to update the path to uploads.

    then after uploding, reset wordpress defauld by:

    update_option('uploads_use_yearmonth_folders', true);