Closed (fixed)
Project:
FileField
Version:
6.x-3.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2009 at 03:46 UTC
Updated:
24 Aug 2009 at 13:08 UTC
is there a way to automatically prepend the username of the uploader along with an underscore?
example:
user "drupalguy" uploads "video.flv"
video uploads as "drupalguy_video.flv"
Comments
Comment #1
nevets commentedYou can get close, configure the field and look under path settings. You could set path settings to
[user]which using your example would give you drupalguy/video.flv (the result is each users video's end in their own directory.Comment #2
robotsguide commentedthat would almost work, except that after it's uploaded, media mover FTPs it from my server to a Content delivery network. I need a way to differentiate the videos by user there.
Comment #3
pbuyle commentedI user FileField Path so I don't know if it is one its features or a FileField one, but in the field settings I can set the filename using tokens. I guess using [user]_[filefield-onlyname-original].[filefield-extension-original] as filename would do what you are looking for.
Comment #4
robotsguide commentedMongolito404,
You are amazing! This worked perfectly for me! here's the token I used if anyone is interested:
[author-name]_[filefield-onlyname-original].[filefield-extension-original]
Comment #5
pbuyle commentedComment #6
pbuyle commented