Permettre a l'utilisateur de pouvoir telecharger le son

Fermé
boni91 - 19 nov. 2017 à 01:45
yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024 - 20 nov. 2017 à 19:17
Bonjour, je voudrai permettre a l utilisateur de pouvoir telecharger le son qui ecoute.


echo'<div style="float:left;margin-left:850px; margin-top:40px; margin-bottom:10px;">';
echo'<a href="'. $audio1 .'" type="audio/mp3" download="download">';
echo'<a href="'. $audio2 .'" type="audio/mp3" download>="download"';
echo'<a href="'. $audio3 .'" type="audio/mp3" download>="download"';
echo'<a href="'. $audio4 .'" type="audio/mp3" download>="download"';
echo'<img style="width="76"; height="76" src="../img/bouton-telecharger.png">';
echo'</a>';
echo'</a>';
echo'</a>';
echo'</a>';


j' ai plusieurs tableaux, voici un bout

	'son_38' => array(
'audio1' => '../mp3_1/page56.mp3',
'img1' => '../img/livre_2.jpg',
'img2' => '../btn/haut-parleur1.png',
'img3' => '',
'text' => '<b>13 - page 56</b> - TP é - è - ê',
'color'=>'#f6c0a8'
),
'son_39' => array(
'audio1' => '../mp3_1/page60.mp3',
'img1' => '../img/livre_2.jpg',
'img2' => '../btn/haut-parleur1.png',
'img3' => '',
'text' => '<b>14 - page 60</b> - Message é / ê / ai / ei',
'color'=>'#f6c0a8'
));?><?php

$secondcatalogue_1 = array(
'son_40'=>array(
'audio2' => '../mp3_1/page70.mp3',
'img1' => '../img/livre_2.jpg',
'img2' => '../btn/haut-parleur1.png',
'img3' => '',
'text' => '<b>15 - page 70</b> - Message é / et / er / ez',
'color'=>'#99e3df'

),
'son_41' => array(
'audio2' => '../mp3_1/page74.mp3',
'img1' => '../img/livre_2.jpg',
'img2' => '../btn/haut-parleur1.png',
'img3' => '',
'text' => '<b>16 - page 74</b> - TP é / et / er / ez ',
'color'=>'#99e3df'
),


merci d'avance
A voir également:

6 réponses

yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024 1 471
19 nov. 2017 à 09:54
bonjour, quel résultat obtiens-tu avec le code que tu proposes?
peux-tu partager aussi le code source html de la page reçue par le navigateur?
0
voici le code source de ce que je télécharge, pas le son:
<!doctype html>
<html lang="fr">
<head>
<title>françaispouradulte
</title>
<!------------------------------balises-meta--------------------------------->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Bandes sons Au boulot ! livre 1 et livre 2 – le français pour adultes – Valérie <b>VERMURIE</b>">
<!-----------------------------styles-css------------------------------------>
<link rel="stylesheet" href="../css/style.css" media="all">
<link rel="stylesheet" href="../css/style_exo_1.css" media="all">
<link rel="stylesheet" href="../css/contact.css" media="all">
<link rel="stylesheet" href="../css/normalize.css" media="all">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="../css/animate.css" />
<link rel="icon" type="image/png" href="../favicon.png" />
<link rel="apple-touch-icon" sizes="120x120" href="../apple-touch-icon-120x120-precomposed.png" /> <link rel="apple-touch-icon" sizes="152x152" href="../apple-touch-icon-152x152-precomposed.png" />
<!-----------------------------styles-font----------------------------------->
<link href='https://fonts.googleapis.com/css?family=Kreon:400,700,300' rel='stylesheet' type='text/css'>
<!-----------------------------script_js----------------------------------->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script src="jquery.js"></script>
<script src="audioplayer.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="audiojs/audio.min.js"></script>
<!--[if IE9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<header class="header_color">
<div id="header_logo">
<img src="../img/logo.png" alt="logo_francais_pour_adultes" />
</div>
<nav class="nav_right">
<li>
<a href="../index.php" title="accueil">ACCUEIL
</a>
</li>
<li>
<a href="../page_principal/exercices.php" title="exercices">EXERCICES
</a>
</li>
<li>
<a href="../page_principal/livres.php" title="livres">LIVRES
</a>
</li>
<li>
<a href="../page_principal/audio.php" style="color:#54d1cd;" title="audio">AUDIO
</a>
</li>
<li>
<a href="../page_principal/contact.php" title="contact">CONTACT
</a>
</div>

</header>
<div id="content">
<br />


<section>
<div style="float:left;"><img width="390" height="580" style="margin:55px 0 60px 250px;" src="" alt=""><img width="960" height="800" style="margin:55px 0 0 -280px;" src="" alt=""></div><div class="clear"></div><div style="float:left;"><img width="390" height="580" style="margin:55px 0 60px 260px;" src="" alt=""><img width="960" height="800"style="margin:55px 0 -50px -280px;" src="" alt=""></div><div class="clear"></div><div style="float:left;"><img width="380" height="600" style=" margin:25px 0 90px 240px;" src="../img/livre_2.jpg" alt=""><img width="940" height="800"style=" margin:25px 0 50px 250px;" src="" alt=""></div><div class="clear"></div><div style="float:left"><img width="940" height="800"style="margin:25px 0 50px 200px;" src="" alt=""><img width="380" height="600"style="margin:25px 0 90px 40px;" src="" alt=""></div><div class="clear"></div><audio style="margin-left:300px;margin-bottom:80px;margin-top:-50px;float:left;" preload="auto" controls><source src="../mp3_1/page41.mp3" type="audio/mp3"/><source src="" type="audio/mp3"/><source src="" type="audio/mp3"/><source src="" type="audio/mp3"/></audio><div style="float:left;margin-left:850px; margin-top:40px; margin-bottom:10px;"><a href="../mp3_1/page41.mp3" type="audio/mp3" download><a href="" type="audio/mp3" download><a href="" type="audio/mp3" download><a href="" type="audio/mp3" download><img style="width="76"; height="76" src="../img/bouton-telecharger.png"></a></a></a></a></div><div style="float:left;width:150px; height:80px; margin:-65px 0 0 710px;"><a style="padding:1em 1.5em .7em 1.5em;border:1px solid #000;text-decoration:none;background:#fff;font-family:notoserif;font-weight:bold;color:#000;" href="http://s642262600.onlinehome.fr//index.php?img=..%2Fimg%2Flivre_1.jpg&prix=18.90&livre_1=ACHETER" >ACHETER</a></div><div class="clear"></div>
</section>
</div>
<!--------------content------>
<footer class="footer_color">
<div class="info_left foot_info_left">
<p>Réalisation du site internet:
<a style="font-size:1.3em;" href="../page_principal/contact_nills.php">Nilsweb
</a>
</p>
<p>© - Le français pour adultes - 2016 - Tous droits réservés.
</p>
</div>
<div class="info_left foot_info_right">
<li class="info-border">
<a href="contact.php">contact
</a>
</li>
<li class="info-border">
<a href="../page_principal/mention.php">Mention légales / Condition générales de ventes
</a>
</li>
</div>
</footer>
</div>
<!--------------wrapper------>
<script src="js/viewportchecker.js">
</script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.post').addClass("hidden").viewportChecker({
classToAdd: 'visible animated fadeInDown', // Class to add to the elements when they are visible
offset: 100
}
);
}
);
</script>
<script type="text/javascript">
$(function() {
$('a[href=#header]').click(function(){
$('html').animate({
scrollTop:0}
, 'slow');
return false;
}
);
}
);
</script>
<script type="text/javascript">
var vid = document.getElementById("audio");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
<script type="text/javascript">
var vid = document.getElementById("son");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
<script type="text/javascript">
var vid = document.getElementById("son_1");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
<script type="text/javascript">
var vid = document.getElementById("son_2");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
<script type="text/javascript">
var vid = document.getElementById("son_3");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
<script type="text/javascript">
var vid = document.getElementById("son_4");
function playVid(id) {
var vid = document.getElementById(id);
vid.play(id);
}
function pauseVid() {
vid.pause();
}
</script>
</body>
</html>

0
yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024 1 471
19 nov. 2017 à 18:54
que se passe-t-il quand l'utilisateur clique sur:
<a href="../mp3_1/page41.mp3" type="audio/mp3" download>
?
0
Boni91 > yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024
20 nov. 2017 à 06:51
Bonjour et merci, Quand j essayé de le telecharger, je reçois une icône d internet explorer et quand je clic sur l icone ca me donne le code source si dessus, non pas le son, alors je me pose la question suivante est ce que cela viendrai pas de php, car j ai mis un lecteur basic HTML5 et ça ne fonctionne pas non plus, pas de pré-chargement de l audio.
Merci pour ton aide
0
je précise que je recuperre les donnees par une boucle foreach.
0
yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024 1 471
20 nov. 2017 à 10:37
que se passe-t'il si tu me l'url vers le fichier mp3 dans la barre d’adresse du navigateur?
0
c est a dire?
0
yg_be Messages postés 22707 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 19 avril 2024 1 471
20 nov. 2017 à 19:17
eh bien, quand tu utilises ton navigateur pour accéder à ton site, tu vois l'adresse de la page dans la barre d'adresse, probablement en haut de la page. tu peux remplacer l'adresse par une autre adresse, et ainsi visualiser la page que tu souhaites.
par exemple, si ta page est https://boutique.francaispouradultes.fr/fr/ ton fichier mp3 serait en https://boutique.francaispouradultes.fr/fr/
et je te suggère donc de vérifier que le fichier mp3 est bien accessible via l'url que tu proposes.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
pour vous est ce que normalement avec cet ligne de code, il devrai pouvoir le telecharger ?,
<a href="'.audio1.'" type="audio/mp3" download>
0
bonsoir, quand je valide l enregistrement pour téléchargé le son, ça copie une page HTML, pouvez vous m aider
0