-
MODX Staff
- 10,725 Posts
You definitely have to create a Content Type for that in MODx. What details did you give the Content Type? And did you assign that Content Type to the Static Resource after creating it? We are serving PDF’s as static resources successfully from modxcms.com using application/pdf, though I think you don’t want attachment as the disposition since browsers typically use plugins to handle these content types.
Maybe I’m misunderstanding the question, but I’m pretty sure I’ve set up .PDF files for download just by using a Static Resource with the Content Type set to Attachment, template set to blank, and the path in the content field -- without creating a new content type. I think having the content type is what’s launching Acrobat.
Quote from: OpenGeek at Jan 27, 2010, 01:13 PM
Quote from: BobRay at Jan 26, 2010, 09:23 PM
Maybe I’m misunderstanding the question, but I’m pretty sure I’ve set up .PDF files for download just by using a Static Resource with the Content Type set to Attachment, template set to blank, and the path in the content field -- without creating a new content type. I think having the content type is what’s launching Acrobat.
Attachment is the content disposition, not content type. If you got it to download it downloaded with the wrong content type header. Browsers are configured to automatically handle PDF files with Acrobat Reader plugins. The disposition may change that but I’m not sure; I think the client controls the action taken by content type (i.e. you’d have to configure the browser to download rather than open PDFs inline).
Right, I meant to say content disposition. I know there’s no way to "force" a download, but IIRC, by changing the disposition I got it to download in some browsers and give a choice between opening it and saving it in others. I’m also pretty sure I opened it with Acrobat after the download and was able to see the content with no trouble.
-
☆ A M B ☆
- 24,524 Posts
It depends on the browser settings. Different browsers (even different versions of the same browser) have different default settings, and in many cases a browser’s global security settings will affect how various files are handled.
I have a related question that was discussed in
this thread. The issue was that binary content (i.e. mp3’s) would not download when a template was assigned to the Static Resource. OpenGeek’s response at the time was:
Templates are not recommended for binary content types
My question is: Is this by design? Is it a bug? Should it be a feature request? Has it already been fixed since the last time the issue was brought up?
I’m trying to figure out if we will we ever be able to use templates and TV’s for binary Static Resource’s. I think this is an important functionality to have available for any situation where one wants to list downloads with additional data associated with them (i.e. IsFree||RegisterToDownload).
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.