-
AuthorPosts
-
chavan Friend
chavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 23, 2014 at 4:03 pm #539889yes It can be done.
1. Use this code in article, add your wav file path in wavsrc=””
{jamedia src="images/audio/wyc/Bubblegoose.mp3" wavsrc="images/audio/wyc/Bubblegoose.wav" type="audio" mtype="mp3" title="Bubblegoose"}
2. Then Go to this File: pluginscontentjaavtracklisttmpl
Replace my Previous Code on that file With
<?php $download = str_replace(JURI::root(), '', $value['wavsrc']); ?>
<a class="jp-download jp-icon" href="<?php echo JURI::base().'index.php?option=com_downloads&task=download&Url='.$download; ?>">DownLoad</a>1 user says Thank You to chavan for this useful post
June 26, 2014 at 11:50 am #540277Hi,
My Site http://www.pint.ru
Download audio works with relative links:
<blockquote><p>{jamedia src=”drive/zvuk_aforizm_964.mp3″ type=”audio” mtype=”mp3″}</p></blockquote>I want to use audio files from another site. Using absolute links:
<blockquote><p>{jamedia src=”http://www.pint.ru/drive/zvuk_aforizm_964.mp3″ type=”audio” mtype=”mp3″}</p></blockquote>
, or:
<blockquote>{jamedia src=”http://pintadmin.podfm.ru/Osvobogdenie__2007/295/download/podfm_pintadmin_Osvobogdenie__2007_20130308.mp3″ type=”audio” mtype=”mp3″ title=”Title1″}</blockquote>How to modify the code to allow absolute link to download?
Help please.
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 27, 2014 at 2:38 am #540354I donno what editor you are using for Article content. But Whatever Editor you use will be as a plugin in Extension Mananger -> Manage -> Plugin Name.
In this section there will be settings for you to make the relative link to absolute link.
If you couldn’t find it, Please post the site Url and admin details.
June 27, 2014 at 7:58 am #540379When editing material I off Editor-TinyMCE.
Using Editor-None:Opened configuration Editor-None:
Settings select the relative link to absolute link – no.
Editor – TinyMCE this setting is. I on this setting:
But this has no effect.
When the mouse is in the status bar is visible absolute link:
File is playing, but when downloading zero size:
- chavan Friend
chavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 28, 2014 at 2:15 am #540436can you please post your site admin Url and admin details in PM. so i can take a look at it and fix things
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 28, 2014 at 3:49 am #540450I have fixed the issue
Here is the Update on the code controller.php
<?php
/**
* @version 1.0.0
* @package com_downloads
* @copyright Copyright (C) 2014. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author chavan <chavansoft@yahoo.com> - http://www.chavansoft.com
*/// No direct access
defined('_JEXEC') or die;jimport('joomla.application.component.controller');
class DownloadsController extends JControllerLegacy
{
public function display($cachable = false, $urlparams = false)
{
$cachable = true;//$path = $_SERVER['DOCUMENT_ROOT']."/path2file/"; // change the path to fit your websites document structure
//$fullPath = str_replace(JURI::base(), '', $_REQUEST['Url']); //$path.$_GET['download_file'];$fullPath = $_REQUEST['Url'];
// $path = parse_url($fullPath, PHP_URL_PATH);//$website = $fullPath;
if (preg_match("/b(?:(?:https?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a-z0-9+&@#/%=~_|]/i",$fullPath)) {
$fsize = strlen(file_get_contents($fullPath)); //filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);switch ($ext) {
case "mp3":
header("Content-type: audio/mpeg"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;case "mp4":
header("Content-type: audio/mp4"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;case "wav":
header("Content-type: audio/vnd.wav"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;default;
header("Content-type: application/octet-stream");
header("Content-Disposition: filename="".$path_parts["basename"].""");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directlyecho file_get_contents($fullPath);
exit;}else{
$path = $_SERVER['DOCUMENT_ROOT']."/path2file/"; // change the path to fit your websites document structure
$fullPath = str_replace(JURI::base(), '', $_REQUEST['Url']);
if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);switch ($ext) {
case "mp3":
header("Content-type: audio/mpeg"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;case "mp4":
header("Content-type: audio/mp4"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;case "wav":
header("Content-type: audio/vnd.wav"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename="".$path_parts["basename"]."""); // use 'attachment' to force a download
break;default;
header("Content-type: application/octet-stream");
header("Content-Disposition: filename="".$path_parts["basename"].""");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
}exit;
}
}June 28, 2014 at 9:59 am #540468Thank you very much for your help! 😀
jp Friendjp
- Join date:
- April 2012
- Posts:
- 105
- Downloads:
- 14
- Uploads:
- 32
- Thanks:
- 32
- Thanked:
- 5 times in 2 posts
June 30, 2014 at 7:55 am #540585Hi Chavan
Some of the download buttons does not want to work
In internet Explorer this is the result (atleast it lets me download)
But this is not how the normal download looks on al the buttons in internet explorer
In Chrome it only gives this error
This is the specific file link, although this is true for more than one file. I cant stream the audio when I press the play
- chavan Friend
chavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
July 1, 2014 at 12:57 am #540720Did you install the Download component, If not please install it from this link.
http://www.joomlart.com/forums/attachment.php?attachmentid=36253&d=1398395411
If you have installed it and still not working then send me your admin details in PM.
jp Friendjp
- Join date:
- April 2012
- Posts:
- 105
- Downloads:
- 14
- Uploads:
- 32
- Thanks:
- 32
- Thanked:
- 5 times in 2 posts
July 1, 2014 at 6:52 am #540743Yes I did install the download componant
As i said some of the downloads works fine and some does not
Regards
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
burakkaynarca Friendburakkaynarca
- Join date:
- April 2007
- Posts:
- 12
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
July 16, 2014 at 7:19 pm #542634<em>@Chavan 433544 wrote:</em><blockquote>yes It can be done.
1. Use this code in article, add your wav file path in wavsrc=””
{jamedia src="images/audio/wyc/Bubblegoose.mp3" wavsrc="images/audio/wyc/Bubblegoose.wav" type="audio" mtype="mp3" title="Bubblegoose"}
2. Then Go to this File: pluginscontentjaavtracklisttmpl
Replace my Previous Code on that file With
<?php $download = str_replace(JURI::root(), '', $value['wavsrc']); ?>
<a class="jp-download jp-icon" href="<?php echo JURI::base().'index.php?option=com_downloads&task=download&Url='.$download; ?>">DownLoad</a>
</blockquote>Thank you so much…
woluweb Friendwoluweb
- Join date:
- October 2012
- Posts:
- 196
- Downloads:
- 18
- Uploads:
- 69
- Thanks:
- 68
- Thanked:
- 31 times in 3 posts
August 11, 2014 at 12:52 pm #545474Hi,
Like everybody, I had the samed problem : clicking on “download” would in fact open the stream.
You can’t expect from “normal visitors” to right-click to overcome the problem.So I was very happy to try your solution, but it did generate an error msg on my site (maybe bc it is multilingual ? it does not matter, read further).
I investigated then for a simple way to allow download in general.
See here http://davidwalsh.name/download-attributeSo what I did is that I edited as you suggested the following file
pluginscontentjaavtracklisttmpldefault_audio_m ini.phpand added download=”” in the href.
With other words, I changed
<li><a class="jp-download jp-icon" href="<?php echo $value['src'];?>">DownLoad</a></li>
Into
<li><a class="jp-download jp-icon" href="<?php echo $value['src'];?>" download="">DownLoad</a></li>
A few days ago, Joomlart updated the player.
But can you please add this in the future release of the plugin jaavtracklist ?
Txs !AuthorPostsThis topic contains 29 replies, has 6 voices, and was last updated by chavan 10 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum