I implement the myModule_webform_submission_insert($node, $submission) {...} function in my Module. It's a regestration webform so I want to save all the data from the webform into a the new user. The user has to upload a file during the registration. I have no idea how to save this file in the user as in $submission[15]['value'][0] I only receive a integer. I have no idea how to get the path the file was actually saved.

Can somebody tell me if it's possible to save the file (uploaded with webform registration form) in the $user_data Array which is the parameter for user_save()?

For example I have this

function blabla_webform_registration_webform_submission_insert($node, $submission) {
// $node->nid will be the node id of your webform
if ($node->nid == 22) {

$submitted_data = $submission->data;
//Get data from field
$file = $submitted_data[15]['value'][0];

//Now $file has the value
// $file[value][0] = 46


What can I do with '46'? :)

Best regards, Christian

1 Answer 1


I believe 46 is the File ID or FID in Drupal. You can load it via file_load() and re-save, move it or attach it to a user profile however you like.

Webform has already saved the file in the system somewhere. You can find out where by inspecting the $file object after $file = file_load(46); and doing a print_r or vardump on $file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.