Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script de téléchargement

Featured Replies

Posté(e)

J'ai récupérer cet exemple mais je n'arrive pas à le mettre en oeuvre:

<?

$chemin= 'modules/fr/download/fichier.pdf';

if ((!file_exists($chemin)) && (!@fclose(@fopen($chemin, "r")))) die('Erreur: fichier incorrect');

$filename = stripslashes(basename($chemin));

$user_agent = strtolower($_SERVER["HTTP_USER_AGENT"]);

header("Content-type: application/force-download");

header(((is_integer(strpos($user_agent,"msie")))&&(is_integer(strpos($user_agent, "win"))))?"Content-Disposition: filename=\"$filename\"":"Content-Disposition: attachment; filename=\"$filename\"");

header("Content-Description: Telechargement de Fichier");

@readfile($chemin);

die();

?>

Le problème est qu'il envoie bien le fichier mais pas le bon nom ...

En fait, il envoie le nom du fichier contenant le script ...

J'ai vérifié la valeur de $filename et elle est correcte ...

C'est de l'entete envoyée que vient le pb mais je n'arrive pas à le trouver ...

Help please ...

Merci

Posté(e)
  • Auteur

Alors, j'ai avancé ...

<?php

$chemin= 'modules/fr/download/fichier.pdf';

if ((!file_exists($chemin)) && (!@fclose(@fopen($chemin, "r")))) die('Erreur: fichier incorrect');

$filename = stripslashes(basename($chemin));

header("Content-Type: application/force-download");

header( "Content-Disposition: attachment; filename=\"$filename\"");

header( "Content-Description: Téléchargement de fichier");

@readfile($chemin);

?>

J'ai viré les trucs qui servaient à rien ...

Il m'envois bien le bon nom du fichier ... mais le fichier est endommagé .. il fait 4 ko de plus à l'arrivée ... :craint:

Au secours ...

Posté(e)
  • Auteur

Ayé ...

<?php

$chemin= 'modules/fr/download/fichier.pdf';

if ((!file_exists($chemin)) && (!@fclose(@fopen($chemin, "r"))))

die('Erreur: fichier incorrect');

$filename = stripslashes(basename($chemin));

header("Content-type: application/download");

header("Content-Disposition: attachment; filename=$filename");

header("Content-Description: Telechargement de Fichier");

readfile($chemin);

die();

?>

voilà le script final ... je sais po d'où venait l'errreur ... du script ou de mon apache qui se serait enervé à un moment donné ...

Sinon, il marche sauf que la fenetre ouverte pendant le téléchargement ne se ferme po automatiquement à la fin du download ...

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.