eZ Community » Forums » Setup & design » Problem with /content/download and...
expandshrink

Problem with /content/download and mp3 files

Problem with /content/download and mp3 files

Monday 03 October 2011 4:12:58 pm - 9 replies

Hi,

I can't find how to solve this :

in a overide template, we have included a mp3 player (jwplayer).
to run, jwplayer needs file url to play with .mp3 extension.

to create the player in the template, we use :
<embed width="200" height="24" flashvars='file={concat("content/download/",$file.contentobject_id,"/",$file.content.contentobject_attribute_id,"/",$file.content.original_filename)}&backcolor=000000&frontcolor=FFFFFF' wmode="opaque" allowscriptaccess="always" allowfullscreen="false" quality="high" name="mpl" id="mpl" style="undefined" src={'flash/player.swf'|ezdesign('double')} type="application/x-shockwave-flash">

Online, the player is displayed in the page, but nothing happens when we want to start to play audio.

firebug gives network error : the file doesn't exists. strangely, when we enter the file url without trailing .mp3, a download dialog box appears.
we also tries to give direct url to file (/var/...), but jwplayer needs trailing .mp3 to detect file format.

.htaccess is ok for mp3 files.

is there something we forgot (or broke) into some EZ .ini file ?

this problem is breaking my brain blunk.gif Emoticon

thanks for your help !
Fred

Monday 03 October 2011 4:56:09 pm

Yes this kind of link - i don't know why - doesn't work anymore.

Try feeding your player with $attribute.full_path to give full var path to mp3 file.

Monday 03 October 2011 5:30:58 pm

Hello Frédéric,

The problem is the 'content/download' module view is for downloading files to your local computer and not accessing them (say within a web page mp3 player).

You should use the actual content object binaryfile path to the file (see ezbinaryfile datatype) to be able to play the file through your web page mp3 player.

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Objects/ezbinaryfile/

I hope this helps

Cheers,

Heath

Monday 03 October 2011 5:31:16 pm

Thanks, HWA, but I already tried this. the problem is the mp3 file if stored like this :

'var/ezwebin_site/storage/original/audio/489736e3841869921dddc82b0e838d29'

as you see, there is no .mp3
I don't know why, but when we upload the mp3 file from within the wysiwyg editor, EZ remove the trailing .mp3 , and obsviously, jwplayer refuses to load file because it jwplayer needs the file extension to detect audio format.
why the editor is doing this ? ini file ? what ?
in conclusion, neither /content/download neither direct download work fork mp3 uploaded from within the wysiwig editor.

has anyone more ideas ?
thx

Monday 03 October 2011 5:49:29 pm

Uhm strange my files keeps their extension after upload but i don't use ezoe (wysiwig) editor for that task.

Could you try to upload your mp3 in a ezfile attribute of your audio class via a regular "create here" action of you admin site and check if your extension is kept.

If so - and according to me - this extension removal is related to the ezoe config.

Modified on Monday 03 October 2011 5:50:07 pm by H-Works Agency

Wednesday 05 October 2011 4:53:48 pm

I've no issue using content/download type of URLs with a flash player:

<object type="application/x-shockwave-flash" data="/extension/opaudioplayer/design/standard/javascript/dewplayer/dewplayer.swf" width="200" height="20" id="dewplayer" name="dewplayer"><param name="wmode" value="transparent" /><param name="movie" value="/extension/opaudioplayer/design/standard/javascript/dewplayer/dewplayer.swf" /><param name="flashvars" value="mp3=http://www.quoc-huy.com/content/download/408/2552/Hotel_California.mp3&amp;autostart=1&amp;autoreplay=1&amp;showtime=1&amp;randomplay=1&amp;nopointer=1" /></object> 

But you are right about var/.../ type of url, they don't have .mp3 extension, except old ones. All my new files are without extensions except one from December 2010.

Anyway, in your content/download URLs, how is the file name? Does it contain any special characters? Does it contain spaces? Can you give us a real example?

Sunday 09 October 2011 8:51:04 pm

Hello,

it's my first time, i think you can use concat like that

<embed width="200" height="24" flashvars='file={concat("content/download/",$file.contentobject_id,"/",$file.content.contentobject_attribute_id,"/",$file.content.original_filename,".mp3"blunk.gif Emoticon}&backcolor=000000&frontcolor=FFFFFF' wmode="opaque" allowscriptaccess="always" allowfullscreen="false" quality="high" name="mpl" id="mpl" style="undefined" src={'flash/player.swf'|ezdesign('double')} type="application/x-shockwave-flash">

to add '.mp3' to your url

I hove i've helped you

Tuesday 17 January 2012 10:12:54 am

Hello Frédéric,

I get exactly the same problem : when I upload an .mp3 file through the ezoe and embed object, files are stored on the filesystem without the .mp3 extension, by example : /var/mysite/storage/original/audio/905a9d0cdc6c7f4143f5571538fd1a10

So, when I try to use the HTML5 audio tag like this...

<audio controls="controls">
<source src="/var/mysite/storage/original/audio/905a9d0cdc6c7f4143f5571538fd1a10">
</audio>

... he refuses to play the file.

Have you found a solution ?

Thanks !

Tuesday 17 January 2012 1:16:29 pm

Hello Sébastien,

 

I think this issue is specific to users who use ezoe to upload audio file content as clearly suggested early in this thread. I suggest you head the advice shared and don't upload audio files through ezoe and do so directly using attribute edit controls while editing a content object.

http://share.ez.no/forums/setup-design/problem-with-content-download-and-mp3-files/comment70816

I your use case I would not be suprized that the audio file uploaded is stored without extension or refuses to play, though I would imagine while frustrating, you could be reassured that this is not a core eZ Publish issue (I think) but rather a side affect of what your trying to do with ezoe. Sorry I do not know why ezoe would do this offhand ... but I'm sure there is a reason.

 

In a way this should help you narrow your search for a fix if not avoid the issue entirely?

 

I hope this helps ...

 

Cheers,

Heath

Modified on Tuesday 17 January 2012 1:18:04 pm by // Heath

Wednesday 18 January 2012 9:05:05 am

Hi Heath,

Thanks for your reply, I'll try to search for a fix because I must leave the opportunity for users to upload audio files as easily as the image files into the ezoe.

Cheer,
Seb 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from