librelist archives

« back to archive

Redirect and download after form submit.

Redirect and download after form submit.

From:
William Martin
Date:
2011-10-18 @ 09:41
Hi loic,

How to redirect the user to an page after a form sublit, and start in
the same time the download of a file created on the fly ?

William

Re: [photon.users] Redirect and download after form submit.

From:
Loic d'Anterroches
Date:
2011-10-18 @ 12:00
Hello,

> How to redirect the user to an page after a form sublit, and start in
> the same time the download of a file created on the fly ?

Interesting, what I would do, is to redirect to an URL like:

http://example.com/service/download/yourfile.zip?id=HEREUNIQUEKEY

Then in the download view, both check that the file is available and
that the user has the rights to download based on the key.

This way, your user can resume the download in case of problem as long
as the file is on the server and the session matches.

loïc