Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't really understand how this module works. Maybe someone can give me some help? All I want it to do is rename the uploaded file to include the user's id number at the beginning of the file name.
example: video.flv renamed to 1_video.flv
after this, it is to be uploaded to an FTP server.
I've got it working to where it will upload the video to the FTP server no problem, but I can't figure out how to rename it. any help would be appreciated.
Comments
Comment #1
anantagati CreditAttribution: anantagati commentedYou should fill into 'Output file' something like this:
[user-id]_[harvest_file]
.Instead of [harvest_file] you may use other states of file depending on in which action is Custom Command used.
And in 'Command' you can copy original file by this code:
cp [harvest_file] [user-id]_[harvest_file]
Comment #2
robotsguide CreditAttribution: robotsguide commentedI tried this and it didn't work. it also made it so it didn't transfer to the FTP server.
Comment #3
anantagati CreditAttribution: anantagati commentedCan you send me info about your configuration?
Comment #4
robotsguide CreditAttribution: robotsguide commentedwhat do I need to send?
Comment #5
anantagati CreditAttribution: anantagati commentedYou go to 'admin/build/media_mover/export' and export Media Mover configuration.
Comment #6
robotsguide CreditAttribution: robotsguide commentedhere's what you asked for:
thanks for your support!
Comment #7
anantagati CreditAttribution: anantagati commentedOk, I looked on it more deeply and it seems that there is need to have some more tokens which will return just filepath, name or extension of file. [harvest_file] also contains path to the file (ex. sites/default/files/gallery/videos/gauranga.mov) so it is hard to use for this case.
I created issue #548062: [mm_token] More flexible tokens for working with files for media_mover/mm_token module.
Comment #8
robotsguide CreditAttribution: robotsguide commentedThank you!
Comment #9
robotsguide CreditAttribution: robotsguide commentedI figured this out using Filefield Paths. There are tokens available within that module to do exactly what I needed. Closing issue.