Webform, creating customized directories for uploaded files Newbie and my first question on here. I'm still learning Drupal. So apologies if I missed anything

Here is my issue
I am using Webform to create an upload page. The user enters an ID(text field) and uploads the file. The file gets uploaded to a private section on the server. Now I am trying to make sure that the file gets uploaded into this separate folder(named after the ID)( say all/private/ID/). Can I do that using a Webform ? For now, all I can use are basic tokens,not values I can grab from other fields(ex: %username) to create these directories.

If webforms are not the answer, what else would be a good method to go about it ?
Greetings welcome to the land of Drupal stuff :)

In general here are some tips:


creating a folder off of a textfield ID is going to be cumbersome. How will you know subsequent users aren't putting in the same ID and or overwriting eachothers files?
Webform has an API of available hooks. For instance look at webform_submission_presave() which allows you to change/capture a users submitted answer and alter it; you could likely alter the destination of the file to be saved, and assure the destination directory exists with a Drupal API function file_prepare_directory.


If you're looking for an all-in-one no code solution. Look at this issue queue PATCH for webform that looks like it supports custom tokens for upload files.