0

I have a file field called "contracts" between my user fields.
What I want is that in the user-profile form this field would come up as a file-download widget.

Does anyone have an idea how to show a file-download widget (even a link to a file would work) in the user-profile form?

2
  • Can you define "file downloadable widget"? Maybe it's just me but I have no clue what you mean. Did I understand correctly that you want to offer a downloadable something in the user profile form? That seems contradictory: a form is for user input, not for retrieving information. Commented Apr 19, 2011 at 7:05
  • the requirement is such that there needs to be a downloadable file in user profile fields :)
    – ayush
    Commented Apr 19, 2011 at 7:27

2 Answers 2

2

Assuming that Your Drupal 7 site is a new site (not upgraded from a D6 installation), I think the best approach is to use the Profile 2 module (dependent on Entity API) and add a file field to the user profile.

1

Drupal 7 includes a file field, and you can add a file field to the user profiles in admin/config/people/accounts/fields.

screenshot #1

In the row "Add new field," you select "File" as "Type of data to store;" the form element to show is automatically set to "File," as that is the only form field you can use, in this case. When you click on save, Drupal will allow you to set the settings for the field.

To be able to select the file field, you need to first enable the File module in admin/modules.

Once a file is uploaded, the field will appear as in the following screenshot, in the user profile. (I have used "File" as field label.)

screenshot #2

The name of the file downloaded is a link that can be clicked.
The file field has also the option to show the content of the uploaded file, instead of the link to the 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.