Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4390
| From | Jörg Burzeja <No_Spam_burzeja@gmx.de> |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Re: HTTP Content Streaming |
| Date | 2018-07-11 19:56 +0200 |
| Message-ID | <fqmuloFmd1sU1@mid.individual.net> (permalink) |
| References | <fqk8egF6u5pU1@mid.individual.net> <m1r2ka218u.fsf@mbp.pflaesterer.de> <fqll4gFei42U2@mid.individual.net> <m1muuy12ju.fsf@mbp.pflaesterer.de> |
Am 11.07.2018 um 12:37 schrieb Karl Pflästerer:
>>>> der alte Code für eine Ausgabe als XLS-Datei funktioniert; der neue Code für
>>>> eine XLSX-Datei zeigt leider einen Fehler an (Dateiformat oder
>>>> Dateierweiterung ungültig).
>>>>
>>>> Der "Microsoft Office MIME types for HTTP Content Streaming" sollte korrekt
>>>> sein:
>>>> https://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc
>>>>
>>>> Hat jemand eine einfache Lösung?
>>>>
>>>> Danke.
>>>>
>>>> // ======================================================
>>>> //old code:
>>>> header('Content-Type: application/vnd.ms-excel');
>>>> header('Content-Disposition: attachment; filename="test.xls"');
>>>>
>>>> // ======================================================
>>>> //new code:
>>>> //header("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
>>>>
>>>> //header('Content-Disposition: attachment; filename="test.xlsx"');
>>>
>>> Wenn das der echte Code ist: Bei header() fehlt "Content-Type:" bei new
>>> code
>>
>>
>> Das ist korrekt.
>>
>> header('Content-Type:
>> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
>>
>> Geht aber leider immer noch nicht.
>
> Ist die übertragene Datei denn eine gültige xlsx Datei? Excel war in
> früheren versionen sehr großzügig und hat auch csv Dateien oder HTML
> Dokumente interpretiert.
Wenn man den (berichtigten) Codeschnipsel meines Ursprungsposts als
PHP-Datei speichert und aus einem Projekt öffnet, sieht man mit 'old
Code', das automatisch eine neue Excel-Datei erstellt und mit dem Inhalt
der im Code enthaltenen HTML-Tabelle geöffnet wird (ich vermute, das
meinst Du mit "frühere Excel-Versionen waren in der Interpretation
großzügig").
Der 'new Code' mit xlsx öffnet zwar ebenfalls eine Excel-Tabelle, zeigt
dann aber einen Fehler an (Dateiformat oder Dateierweiterung ungültig).
Scheint wohl als einfachste Lösung nicht auszureichen, den geänderten
mimi-Type im Header zu hinterlegen, oder gibt es doch noch eine Möglichkeit?
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-10 19:24 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 00:07 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 08:07 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 12:37 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 19:56 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 21:55 +0200
Re: HTTP Content Streaming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-07-11 23:32 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-12 20:29 +0200
Re: HTTP Content Streaming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-07-11 00:28 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 08:06 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-12 20:53 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-13 10:21 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-13 08:33 +0000
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-13 23:26 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-14 06:12 +0000
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-15 20:39 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-16 05:47 +0000
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-16 20:48 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-17 21:21 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-18 15:26 +0000
csiph-web