2

I have a Content type with a file field. I want to add another field (download button) which when users click on that, they would be able to download the file (uploaded in file field), and show file field as a simple preview image or even hidden it.
Is there any module to do this(1:create a button with custom css through cck and 2: automatically link the file path to download button), or any other ways?

1 Answer 1

4

The generic file output of the file field is pretty close to what you are asking. It creates a link with a icon showing the file type and links to the file (download, unless the browser understands the file, like an image would be displayed in the browser instead of being downloaded)

You could with theming/css alter the appearance if you so please.

If you want force download, you have to modify the headers sent to the browser. You can use the File Force Download if this is your goal (Thanks for the tip @nicoz). It seems to be using field formatters, which functions much like the generic file display possible with file fields.

1

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.