Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
disable the auto-download behavior of files
i think this is a mime problem – but mp3s and mp4 video files that are hosted in the Files tab do not play on the iPhone.
it is something to do with the behavior that makes these files auto download instead of play in the browser (sometimes a desirable scenario for things like PDFs). can i disable that?Offline
Re: disable the auto-download behavior of files
bueler, anyone? it’s also a problem for posting media files to facebook. thanks!
Offline
Re: disable the auto-download behavior of files
do you use some media plugin or media script? How your media files played from browser? or how you show files in your site?
Last edited by Katalonian (2010-08-04 17:26:47)
<txp:txp_me />
Offline
Re: disable the auto-download behavior of files
well on my site they play out of a flash/javascript player. it reads them fine so that’s not a problem.
but i did tests and found that a mp3 uploaded through the files tab will not play on the iphone (quicktime engine), but mp3s just uploaded to the server normally will play.
on facebook if you share a mp3 like this it’s supposed to enclose it in a flash player. but with the file above it won’t do that because it’s a textpattern-hosted file.
Offline
Re: disable the auto-download behavior of files
mrtunes wrote:
but i did tests and found that a mp3 uploaded through the files tab will not play on the iphone (quicktime engine), but mp3s just uploaded to the server normally will play.
Instead of using the TXP’s force-download link, link directly to the files. The download link that TXP generates makes, forces the client to download the file, but if you just want to stream the file, or link it directly, then you are better with linking the files well… directly, not thru the force-download procedure.
Not with links like http://example.com/file_download/id
, but http://example.com/real/file/location/file.mp3
If you are using TXP’s file tags in file listings (tags within file_download_list etc.) you can replicate/replace <txp:file_download_link />
with something like <txp:site_url />path/to/files/<txp:file_download_name />
.
Offline
Re: disable the auto-download behavior of files
oh ok that makes sense then. good workaround!
Offline
Re: disable the auto-download behavior of files
Nora Brown made a nice video on this subject – you can see it on TXP Tips.
Offline
Re: disable the auto-download behavior of files
so if i had previously linked to the file using:
<a href=”<txp:file_download_link id=”<txp:custom_field name=“file_number” />” />” class=“inline-playable”>
i can use?
<a href=”<txp:site_url />folder/<txp:file_download_name />” >
Offline
Re: disable the auto-download behavior of files
mrtunes wrote:
i can use?
Heh, depending on the context. Like that, not. The tag wouldn’t know where it’s coming from. Instead it should be either be used within file_donwload_list
or file_download_link
.
- See file_download_name
- See file_download_list
- Bookmar Tag Reference
In the article:
<txp:file_download_list id='<txp:custom_field name="file_number" />' />
And in the files form:
<a href="<txp:site_url />path/to/<txp:file_download_name />" class="inline-playable">
<txp:file_download_name />
</a>
Or if you are using it just to generate link in a article, you could just do (without any tags):
"Link":/path/to/file.mp3
Or:
<a href="/path/to/file.mp3">Link</a>
Offline
#10 2010-09-11 17:53:43
- masa
- Member
- From: North Wales, UK
- Registered: 2005-11-25
- Posts: 1,095
Re: disable the auto-download behavior of files
I have a similar problem. I was asked to develop an intranet that manages a large number of PDFs and I need to make sure they open directly in the browser window.
The users should only need to upload the PDFs, categorize them and write a description. I want to then use txp:file_download_list to generate the listings. But how do I need to modify it to produce links that won’t force the download?
In this case there won’t be an article or any other way for users to manually type in a path as this would just be too time-consuming.
Offline
#11 2010-09-11 19:31:40
- masa
- Member
- From: North Wales, UK
- Registered: 2005-11-25
- Posts: 1,095
Re: disable the auto-download behavior of files
Playing around with Jukka’s sample brought the solution using the following in the files form:
<a href="<txp:site_url />files/<txp:file_download_name />"><txp:file_download_name /></a>
<br />
<txp:file_download_description />
I’m just wondering… the links created contain spaces and all sorts of special characters found in the actual filename. It seems to work fine here or might I get into trouble down the line?
Offline