From ooioo at free.fr Thu May 15 05:44:06 2025 From: ooioo at free.fr (ooioo) Date: Thu, 15 May 2025 14:44:06 +0200 Subject: [pmwiki-users-fr] forcer le download sur un lien Message-ID: Bonjour, dans la page https://www.pmwiki.org/wiki/PmWiki/Links-Talk j'ai trouvé le moyen de forcer le "download" des liens dans mes pages wiki $IMap['Download:']="$1"; $IMapLinkFmt["Download:"] = "\$LinkText"; $LinkFunctions['Download:'] = 'LinkIMap'; puis [[Download:/path/to/file.txt|file.txt]] ça fonctionne parfaitement, mais je voudrais n'indiquer que le nom du fichier dans la ligne ci-dessus et que le path soit uploads/NomDuGroupe : [[Download:file.txt|file.txt]] j'ai essayé de modifier le code PHP pour intégrer $UploadDir et $Group sans succès. Merci par avance et merci pour les réponses précédentes auxquelles j'ai répondu directement et non dans la mailing liste. Elles fonctionnaient parfaitement, bien sûr ! Cordialement, Pierre N. From 5ko at 5ko.fr Thu May 15 06:15:19 2025 From: 5ko at 5ko.fr (Petko Yotov) Date: Thu, 15 May 2025 15:15:19 +0200 Subject: [pmwiki-users-fr] forcer le download sur un lien In-Reply-To: References: Message-ID: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> Il y a un meilleur moyen: Dans config.php: $WikiStyle['download']['download'] = '1'; $WikiStyleAttr['download'] = 'a'; Dans une page: %download% [[(Attach:)file.txt]] %% Petko -- If you upgrade : https://www.pmwiki.org/Upgrades On 15/05/2025 14:44, ooioo wrote: > Bonjour, > dans la page > https://www.pmwiki.org/wiki/PmWiki/Links-Talk > j'ai trouvé le moyen de forcer le "download" des liens dans mes pages > wiki > > $IMap['Download:']="$1"; > $IMapLinkFmt["Download:"] = " rel='nofollow' download>\$LinkText"; > $LinkFunctions['Download:'] = 'LinkIMap'; > > puis > > [[Download:/path/to/file.txt|file.txt]] > > ça fonctionne parfaitement, mais je voudrais n'indiquer que le nom du > fichier dans la ligne ci-dessus et que le path soit > uploads/NomDuGroupe : > > [[Download:file.txt|file.txt]] > > j'ai essayé de modifier le code PHP pour intégrer $UploadDir et $Group > sans succès. From ooioo at free.fr Thu May 15 07:47:52 2025 From: ooioo at free.fr (ooioo) Date: Thu, 15 May 2025 16:47:52 +0200 Subject: [pmwiki-users-fr] forcer le download sur un lien In-Reply-To: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> References: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> Message-ID: <643ac63e-f94b-4ed1-bf66-15ec3b082e60@free.fr> Hello, ça marche mais le nom du fichier par défaut  à enregistrer est "1" au lieu du nom original du fichier. Pierre. Le 15/05/2025 à 15:15, Petko Yotov a écrit : > Il y a un meilleur moyen: > > Dans config.php: > >   $WikiStyle['download']['download'] = '1'; >   $WikiStyleAttr['download'] = 'a'; > > Dans une page: > >   %download% [[(Attach:)file.txt]] %% > > Petko > From ooioo at free.fr Thu May 15 07:49:36 2025 From: ooioo at free.fr (ooioo) Date: Thu, 15 May 2025 16:49:36 +0200 Subject: [pmwiki-users-fr] forcer le download sur un lien In-Reply-To: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> References: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> Message-ID: <9a9dd580-d59f-42af-96a6-681981402bf3@free.fr> Ha, en mettant $WikiStyle['download']['download'] = ''; ça marche me semble-t-il ! Le 15/05/2025 à 15:15, Petko Yotov a écrit : > Il y a un meilleur moyen: > > Dans config.php: > >   $WikiStyle['download']['download'] = '1'; >   $WikiStyleAttr['download'] = 'a'; > > Dans une page: > >   %download% [[(Attach:)file.txt]] %% > > Petko > From 5ko at 5ko.fr Thu May 15 09:01:41 2025 From: 5ko at 5ko.fr (Petko Yotov) Date: Thu, 15 May 2025 18:01:41 +0200 Subject: [pmwiki-users-fr] forcer le download sur un lien In-Reply-To: <9a9dd580-d59f-42af-96a6-681981402bf3@free.fr> References: <6355f796dd6b1b526a4c63225be34c88@5ko.fr> <9a9dd580-d59f-42af-96a6-681981402bf3@free.fr> Message-ID: En effet, il suffit d'avoir l'attribut présent mais vide. Petko -- If you upgrade : https://www.pmwiki.org/Upgrades On 15/05/2025 16:49, ooioo wrote: > Ha, en mettant > $WikiStyle['download']['download'] = ''; > ça marche me semble-t-il ! > > Le 15/05/2025 à 15:15, Petko Yotov a écrit : >> Il y a un meilleur moyen: >> >> Dans config.php: >> >>   $WikiStyle['download']['download'] = '1'; >>   $WikiStyleAttr['download'] = 'a'; >> >> Dans une page: >> >>   %download% [[(Attach:)file.txt]] %% >> >> Petko >>