1

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

http:///sites/default/files/webform/

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

http:///sites/default/files/webform?fileid=1502

Thanks for any assistance given

Newbie

0

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

<?php

$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!

0

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.