Let's a filefield with normal widget. No need to browse the media library, always need to upload directly, to a specific folder, and never let user to change it. In this field we doesn't need to use any media feature during the upload.
But after uploaded, need to show the uploaded file in the media library.

The field settings, I set up this path: media/my_path
Then I go to the Add media folder page, and add my_path with parent Media Root.

I upload a file via this filefield, then go to the Media Library, and the uploaded file is shown under Media Root against the path is media/my_path/filename.ext

Imho the possible solution could be check in hook_file_presave, if uploaded source is not the media widget, then set the folder term tid of file file object, if the path is a media path.

CommentFileSizeAuthor
#1 1284186_1_set_media_folder.patch2.02 KBszantog

Comments

szantog’s picture

StatusFileSize
new2.02 KB

and patch against master of git://github.com/Buesing-Sebastian/Drupal---Media-Browser-Plus.git

szantog’s picture

Status: Active » Needs review

needs review