By which way I can specify upload path for media field?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | upload_path_fix-1364676-0.patch | 1.06 KB | chi |
By which way I can specify upload path for media field?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | upload_path_fix-1364676-0.patch | 1.06 KB | chi |
Comments
Comment #1
medden commentedGo to 'admin/config/media/file-system' and set your site wide paths there.
For MultiMedia Asset Fields
Then if you add a media field to any content types, editing that field gives you the option to save as private or public (also others like youtube / flickr if installed).
For Image Fields, I think you can specify further options such as full path / sub directory / tokens.
Comment #2
chi commentedI cannot find further options for images. I am looking for a way to specify subdirectory for images uploaded by Media module.
Comment #3
medden commentedI think sub directories are only available if you use the Drupal core image upload handling.
Perhaps this should be a feature request for the Media module.
Comment #4
chi commentedCan you explain me why all my images are saving in sites/default/files/null directory?
I think it's a bug.
Comment #5
chi commentedI found this code in includes/media.fields.inc
So it may be possible to specify upload path, but I cannot find a way to set $field_settings['file_directory'] variable.
Comment #6
medden commentedI checked, and yes it is possible to specify upload directory.
When you add a new field to your content type... select IMAGE then MULTIMEDIA ASSET
The edit field will now allow you to specify a subdirectory.
Comment #7
chi commentedWhich version of the module are you using?
Comment #8
chi commentedYou are right. I can use image or file field instead of the Multimedia assert field. These fields also supported by "Media file selector" widget. Now I've checkout 2.x version and I am seeing that this field type (Multimedia assert) is deprecated.
But nevertheless, null directory confused and I made a little patch to fix it.
Comment #9
chi commentedComment #10
dave reidAh! Now I see why this is happening - because JavaScript interprets 'NULL' as an actual string. Should we also be fixing max_filesize as well?
Comment #11
dave reidMarked #1351890: Wrong upload destination folder "null" as a duplicate of this issue.
Comment #12
dave reidGreat, committed #8 along with a fix for max_filesize as well to both branches.
http://drupalcode.org/project/media.git/commit/d817ae5
http://drupalcode.org/project/media.git/commit/7f8e5f4