.MP4 coverts to text download problems

I have a clients site, which needs a myfile.mp4 file download.

But the file downloads from the server as myfile.mp4.txt.

Any ideas on a fix?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

for the moment, as a workaround the movie can be placed within the page rather than a download link.

But the movie starts playing on page load. Can this behavior be prevented? In need it not to auto play. (overriding the default play on load setting in the browser)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

bearing in mind, the file need to be .mp4, so the standard Freeway control files are not present.

Can I control (stop autoplay) for .mp4 files? don’t mind editing the code.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It sounds to me as though your server is not set up to handle these
files, and is doing something clever on its end. This does not appear
to be something that Freeway can influence directly.

Talk to your hosting provider about configuring the server to
recognize the mp4 file-type and send the proper file-type header with
it.

Walter

On Feb 10, 2008, at 7:47 AM, dwn wrote:

I have a clients site, which needs a myfile.mp4 file download.

But the file downloads from the server as myfile.mp4.txt.

Any ideas on a fix?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter,

This looks like just a Safari problem as the files download correctly in Firefox OSX, Firefox XP SP2 and Internet Explorer 7 on XP SP2.

Of course just taking off the .txt converts the downloaded file back to .mp4


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 10/2/08 (at 15:33 -0500) dwn said:

Walter,

This looks like just a Safari problem as the files download
correctly in Firefox OSX, Firefox XP SP2 and Internet Explorer 7 on
XP SP2.

Weird. If anything, Safari should be the most able to handle MP4 video files.

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I beg to differ. The files, for whatever reason, are not being sent
by your server with the correct MIME-type, and Safari is being
conservative here and tacking on the .txt to what it interprets as an
“unknown” file-type. Safari can play an .mp4 file – just drag one
into the Safari window to confirm this. The fact that other browsers
demonstrate a willingness to indulge in risky assumptions does not
prove that the server is fine. Your server needs to send Content-
type: video/mp4; along as a header before sending any data from an
mp4 file. The behavior you describe would argue that it does not do
this.

Can you post a link to a movie on your server? I can check this
assertion out in Firefox with Firebug very easily.

Walter

On Feb 10, 2008, at 3:33 PM, dwn wrote:

Walter,

This looks like just a Safari problem as the files download
correctly in Firefox OSX, Firefox XP SP2 and Internet Explorer 7 on
XP SP2.

Of course just taking off the .txt converts the downloaded file
back to .mp4


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If found this which seem to answer what is going on;

“Some web servers are configured to serve .mp4 with the text/plain content type. Safari respects this type and duly adds the .txt extension. Some other browsers will leave the extension as-is.”


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And it seems Safari 10.4 has this issue, whilst Safari intel does not.

so problem over. The client can live with that.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 10/2/08 (at 15:54 -0500) dwn said:

And it seems Safari 10.4 has this issue, whilst Safari intel does not.

so problem over. The client can live with that.

Perhaps the client can live with that, but the problem is certainly
not over. The web server seems to be misconfigured for this kind of
media, which would make me wonder about other aspects too.

At the very least you should try to put some kind of workaround in
place; send Walter a URL for an MP4 video file on that server so he
can check and possibly suggest a way forwards.

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Keith,

Its just .mp4 that is the issue, for example a .mov is OK. The vast majority of browsers can cope either way, and after contacting the host, these settings can’t be changed server side.

So unless there is a coding method of making it download, just for Safari on Power Mac, its easer to convert the .mp4 to .mov files instead.

thanks


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 10/2/08 (at 17:01 -0500) dwn said:

Its just .mp4 that is the issue, for example a .mov is OK. The
vast majority of browsers can cope either way, and after contacting
the host, these settings can’t be changed server side.

Fair enough. But I still say it indicates a bit of blindness on the
part of the host that would make me a trifle uncomfortable.

The MP4 format is fairly modern, but it isn’t what I’d regard as
excessively rare. Not supporting serving it is the kind of thing that
would make me consider taking my or my client’s business elsewhere.
If possible.

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, you said:

Your server needs to send Content-
type: video/mp4; along as a header before sending any data from an
mp4 file.

As the server apparently doesn’t do this, is it something that could
be set up by script in some way?

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, the first place I would start is in an .htaccess file. See if
simply adding this line makes it work:

AddType mp4 video/mpeg

If your server is Apache, and if you are allowed to do these changes
in your hosting environment, then that one line in a plain-text file
called .htaccess (leading period/full stop incredibly important here)
in the same folder as your files, or in any folder “above” it in the
filesystem hierarchy will do everything you need.

If that doesn’t work for some reason, then you could attack it with
larger weapons.

In PHP, you would save the following in a plain text file and call it
mp4.php.

<?php
$base = dirname(__FILE__);
$file = trim(strip_tags($_GET['f']));
header('Content-type: video/mpeg');
header('Content-disposition: inline');
readfile($base . '/' . $file);
?>

Upload this file to your Resources folder on your server. It won’t
work locally unless you have enabled PHP on your Mac.

Then in your Freeway file, when you wanted to link to a video in this
format, you would manually write the URL yourself, like this:
Resources/mp4.php?f=myvid.mp4.

Make sure that your video files are getting uploaded to the server –
I recommend using Upload Stuff or Extra Resources for this, or even
simpler, just make a scratch page and drag them on it.

Walter

On Feb 10, 2008, at 5:22 PM, Keith Martin wrote:

Walter, you said:

Your server needs to send Content-
type: video/mp4; along as a header before sending any data from an
mp4 file.

As the server apparently doesn’t do this, is it something that could
be set up by script in some way?

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter,

The server says its running Redhat Enterprise Linux.

Yes I can edit the .htaccess file so I will have a test of what you suggest.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The .htaccess did not work.

The PHP did work a little. The file did not open as text, it opened a safari window with a Quicktime question mark.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you post a link? Or take a look in Safari > Window > Activity and
see what it reports as the problem with the file. I may need to add a
few more lines to it, so the server can specify the file size. It may
also be that the path is not correct – that middle bit with the . '/' . might be superfluous.

Walter

On Feb 11, 2008, at 6:14 AM, dwn wrote:

The .htaccess did not work.

The PHP did work a little. The file did not open as text, it
opened a safari window with a Quicktime question mark.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If I look in the safari activity window, the link reads:

...text/Resources/mp4.php?f=test.mp4

test.mp4 being the file name to test

But if I right click to download the file, the file name saved to disk is mp4.php.mpg

I assume the PHP is not naming the file correctly.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Aha. Okay. Change the disposition header to read thusly:

header('Content-disposition: attachment; filename="' . $file . '"');

And that should clear things up for you.

Walter

On Feb 11, 2008, at 11:08 AM, dwn wrote:

If I look in the safari activity window, the link reads:

...text/Resources/mp4.php?f=test.mp4

test.mp4 being the file name to test

But if I right click to download the file, the file name saved to
disk is mp4.php.mpg

I assume the PHP is not naming the file correctly.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry this does not work either, can I check the whole code is correct?

<?php $base = dirname(__FILE__); $file = trim(strip_tags($_GET['f'])); header('Content-type: video/mpeg'); header('Content-disposition: attachment; filename="' . $file . '"'); readfile($base . '/' . $file); ?>

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options