Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jun 2011 at 22:51 UTC
Updated:
7 Dec 2012 at 16:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aaron commentedI set this as another issue, because it's probably slightly more difficult than the first.
Comment #2
damienmckennaSubscribe.
Comment #3
gusaus commentedSeems like there may be some overlap with these issues?
#1096374: Provide administrator with ability to customize upload directory, globally and per-field, with token integration
#1069582: How to use an alternate stream wrapper when saving media files?
Comment #4
dddbbb commentedsub
Comment #5
dave reidProper tag
Comment #6
Niklas Fiekas commentedSubscribe.
Comment #7
yareckon commentedsub
Comment #8
Poieo commentedSubscribing.
Comment #9
tsvenson commented+1 this would be very useful to have. But I hope the setting will only be used as a default, suggested, value that can be overridden by for example a media manager module or options set when uploading a new file.
Comment #10
rodrigoaguilerasub
Comment #11
tsvenson commentedMoving this to the 2.x branch, setting backport tag.
Comment #12
screenage commentedsubscribing
Comment #13
tsvenson commentedI've come up with a sort of workaround for this using the IMCE module. Requires a bit more work, but you get the files stored where you want them at lest.
You'll find it at the end of http://www.drupalmill.com/blog/tsvenson/2011/08/08/media-module-needs-fu...
Comment #14
rodrigoaguilerasub
Comment #15
dave reidComment #16
dave reidComment #17
tribsel commented...also public/private settings should be respected, currently its not. When using browser widget, files are always uploaded to public directory
Comment #18
chiebert commentedSub
Comment #19
acbramley commentedsub
Comment #20
bochen87 commentedsubscribe! we would be willing to help, as we especially need the directory feature for media 7.x-1.x version.
Can anyone point me where I have to do what so that media field can have directories where they are saved?
Comment #21
ParisLiakos commentedSubscribe and want to help too.
some guidance on this would be appreciated
Comment #22
acbramley commentedHas there been any progress on this?
Comment #23
acbramley commented#13 worked for me but only for image files? I uploaded a PDF through IMCE but it did not show in media browser.
Comment #24
bensnyder commentedsub
Comment #25
becw commentedComment #26
idiotzoo commentedsub
Comment #27
dave reidWe decided to form alter the description field out. This is better handled by fields on files.
Comment #28
becw commentedHere's a patch that uses the file extensions and file size from the file field instance for upload validation, and uses the file field instance file directory and file field URI scheme for saving the file.
This patch changes the parameters to
media_add_upload(), which might be a problem--instead of providing an array of media types as the first parameter (after$formand&$form_state), it passes an array of parameters that includes the 'types' array. Woo, nested configuration arrays. If necessary, the parameters array could be an extra optional parameter instead.This patch may require a followup issue for dealing with previews of private files--and possible ALL media display of private files.
Comment #29
dave reidWe need to use some similar logic from file_field_widget_upload_validators():
Comment #30
dave reidComment #31
robeano commentedTested successfully on 2.x and 1.x. Ran automated tests successfully as well.
Comment #32
dave reidCommitted #30 to Git (attributed to becw) and 7.x-1.x and 7.x-2.x.
http://drupalcode.org/project/media.git/commit/0b95bf8
http://drupalcode.org/project/media.git/commit/d18f7ae
Comment #34
stephen Piscura commentedI'm sorry to re-open this issue, but it's not immediately clear to me how this commit accommodates the support request originally made here: #1096374: Provide administrator with ability to customize upload directory, globally and per-field, with token integration and in particular the need to specify a custom upload directory for files uploaded from admin/content/file, as opposed to files uploaded via a field on a node or entity. To be clear, files uploaded via the media browser widget on an image-field or file-field are respecting custom directory settings (and tokens! Whew!). But is there a means to specify a custom upload directory when using the media browser at admin/content/file, so that all files uploaded here do not live at the top level of one's public file system path?
Comment #35
muriqui commentedHey stephen... In #1243006: Uploading a textarea image to a particular folder, one of the Media maintainers (arthurf) stated that he felt this functionality was better handled by an add-on module. To that end, I've created a sandbox project called Media upload directory that provides default directories by file type, regardless of whether the media file is attached to a field.
The implementation was pretty simple (just a config form and a few lines of additional validation on upload), so I'd love it if arthurf or another Media maintainer could take a look at that sandbox and reconsider whether or not this should be included directly in Media. If yes, then I can reformulate it as a patch and post here. If not, I'll promote to a full project and maintain it separately. Thanks!
Comment #36
stephen Piscura commentedMuriqui, thanks so much for your work on the upload directory module. I'm going to test it out and i'll be sure to list any findings/bugs/whatever in its issue queue. I think this kind of functionality belongs in the media module itself, simply because it resolves such a seemingly fundamental need: file organization.
Comment #37
Andrea C commentedSubscribe
Comment #38
dddbbb commented@Andrea C NO! Follow, don't subscribe. http://drupal.org/node/1306444
Comment #39
dave reidThe admin/content/file directory lacks any kind of 'field context' so if you want that type of feature you need to open a new feature request. This bug as originally reported is being marked back as fixed.
Comment #40
socialnicheguru commentedcould you use filefield_paths to get what you need?
Comment #41
Anonymous (not verified) commentedMy experience is that when you use the Media widget on an ImageField, it respects the proper file path. However, when I use the Media WYSIWYG editor button, it does not respect it, and places it into the default "files" directory. I'm guessing this still needs to be fixed?
EDIT: Apologies, I just noticed this bug is listed for 7.x-2.x, whereas I'm using 7.x-1.x. (It's a site that I'm building for a client, so I need a stable release.) Perhaps this is the wrong place to post this then?