Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

Empfohlene Antworten

Veröffentlicht

Gibt es eine Möglichkeit, eine Datei dem Besucher mal zum Download anzubieten und mal zur Ansicht im Browser darzustellen? mir ist bewusst, dass die Datei ein Format haben muss, die ein Browser auch darstellen kann. Ich dachte da an PDF-Dateien. Ich habe auch schon einmal erlebt, dass man PHP (absichtlich) als Download bekam. Wie funktioniert das?

Ich danke euch, für eure Hilfe!


<?php
header('Content-type: blabla/pdf');
header('Content-Disposition: attachment; filename="blabla.pdf"');
readfile('orig.pdf');
?>
[/PHP]

Hiermit könntest du den Browser zwingen des DL Fenster anzuzeigen.

Lies am besten dies hier mal

  • Autor

Headers müssen ja zu beginn der Datei stehen,wenn noch keine Ausgaben erfolgt sind. Wie mache ich das, wenn ich mehrere Dateien habe?

Mein Ziel: Ich habe eine Tabelle auf der Seite wo man die Datei entweder ansehen oder downloaden kann:

So in etwa:

Datei1 Ansehen Downloaden

Datei2 Ansehen Downloaden

Datei3 Ansehen Downloaden

Datei4 Ansehen Downloaden

Datei5 Ansehen Downloaden

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.