I have a webform that allows users to upload their CV/Resume's. The webform is sending me the file id. I know that the URL for accessing those files is


Can I access the file for download using the file ID instead of it's name? e.g.


Thanks for any assistance given



Yes. You can use the drupal file_load() function to load the uploaded file.


$fid= 1502;
$file = file_load($fid);


It will return the details of a file in the form of an array.

Hope it works for you!


If you're looking to do this in code, I believe that this question has already been answered:

Given a File ID (fid) how can I get the HTML that represents that fid?

You can also access the file's page at yoursiteurl/file/fid, but this isn't a direct link to the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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