Placing media content in subdirectories

Hello guys,

just a quick question: is it possible to place media content under the same storage but in different sub-directories based on a parameter in the “submitting form”? Lets say that this parameter is a textbox named “slug”.

By entering “apple” the media file will be placed into /path-to-storage/media/apple/file.mp4 while by entering “orange” it will be placed into /path-to-storage/media/orange/file.mp4.

Thanks,
S