Autor Beitrag
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 18.01.11 10:59 
Hallo,

wir benutzen eine Html-Seite mit embed-Tag um ein dynamisch generiertes PDF anzuzeigen. Für die Generierung wird entsprechend eine URL mit Parametern verwendet. Also sowas:
ausblenden Quelltext
1:
<embed src="http://1.1.1.1/cgi/bla?bla=haha&xy=Test.pdf" width="100%" height="100%"></embed>					


Dadurch hat der eingebettete Reader keinen Dateinamen. Wenn man jetzt im Reader auf speichern drückt, benutzt dieser einen zufällig generierten Dateinamen.

Kennt jemand eine Möglichkeit einen Dateinamen zum Speichern zu übergeben? Versuche mit #nameddest am Ende der URL und ähnliches haben nicht funktioniert (und ich bin auch gar nicht sicher, ob das dafür ist).

Vielen Dank schonmal,
schönen Gruß,
Sebastian
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Di 18.01.11 16:29 
Was du suchst, ist der HTTP-Header:

ausblenden Quelltext
1:
Content-Disposition: inline; mypdfname.pdf					

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
jaenicke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 18.01.11 17:48 
Ok, dass das auch mit embed funktionieren könnte, hätte ich nicht gedacht. Das teste ich morgen gleich, danke. ;-)
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 18.01.11 21:32 
Dazu gibt's auch ein RFC: RFC 2183. Ferner bitte RFC 2231 beachten.

Für etwas mehr Unterhaltung siehe auch diesen Link.

Ansonsten gilt die Grundlektüre von RFC 822, RFC 2822 und RFC 2047.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.