Viewing 14 posts - 16 through 29 (of 29 total)
  • Author
    Posts
  • chavan Friend
    #539889

    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>

    pintadmin Friend
    #540277

    Hi,

    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.


    1. Absolute_link_fail_download
    chavan Friend
    #540354

    I 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.

    pintadmin Friend
    #540379

    When 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:


    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    chavan Friend
    #540436

    @pintadmin

    can you please post your site admin Url and admin details in PM. so i can take a look at it and fix things

    chavan Friend
    #540450

    I 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 directly

    echo 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;

    }
    }

    pintadmin Friend
    #540468

    Thank you very much for your help! 😀

    jp Friend
    #540585

    Hi 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

    download


    1. download1
    2. download2
    3. downloadChrome1
    chavan Friend
    #540720

    @jptromp

    Did 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 Friend
    #540743

    Yes I did install the download componant

    As i said some of the downloads works fine and some does not

    Regards

    chavan Friend
    #540837

    @jptromp

    can you please post the admin details in PM.

    burakkaynarca Friend
    #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 Friend
    #545474

    Hi,

    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-attribute

    So what I did is that I edited as you suggested the following file
    pluginscontentjaavtracklisttmpldefault_audio_m ini.php

    and 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 !

    chavan Friend
    #545494

    ok will post a request to the Development team.

Viewing 14 posts - 16 through 29 (of 29 total)

This topic contains 29 replies, has 6 voices, and was last updated by  chavan 10 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum