[TYPO3-mvc] Correct way to write a Download Action?

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Mon Jun 27 22:11:56 CEST 2011


Andre Flitsch wrote:
> Just
> wondering what is the correct way to do it? When i use this method the
> web site is taken to a visual dead end. The download starts, but there
> is no display in the frontend (of course, because of the exit statement).

Yes, sending the file with appropriate headers
is imo the correct way to do so.

Just link to your script instead to the file
directly, and output the content and headers,
and the browser won't display it as a page.

Like this:
<a href="/?eID=ext_download&file=z7Dh30HOfjLD">File 1</a>

Then in the eID script you can use the mentioned code.

That's a basic implementation.

Regards,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list