Drupal 7 redirect to file download
Collectives on Stack Overflow. Learn more. Spring - download file and redirect Ask Question. Asked 8 years, 3 months ago. Active 2 years, 2 months ago. Viewed 12k times. Add a comment. Active Oldest Votes. Request flow is illustrated here: where yellow circle is your controller. In your case you perform actions: response.
Nothing will change. You can: response. Atan Atan 81 4 4 bronze badges. Override PHP settings that cannot be changed at runtime. PHP 5, Apache 1 and 2. Enable expirations. ExpiresActive On. Cache all files for 2 weeks after access A. ExpiresDefault A Do not allow PHP scripts to be cached unless they explicitly send cache.
Otherwise all scripts would have to overwrite the. This may. ExpiresActive Off. Various rewrite rules. Podcast what if you could invest in your favorite developer? Who owns this outage? Building intelligent escalation chains for modern SRE. Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Linked 0. Related 4. Hot Network Questions. Featured on Meta. Now live: A fully responsive profile.
Reducing the weight of our footer. Related 0. Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings. It would be much better to require them to click on a verification link in their email before you log them in and allow them to download a file. Unfortunately this adds a lot of complexity to the process.
We did implement it for a client a couple years ago in Drupal 6 and the same process would work in Drupal 7 but we don't have any code for it yet. Here is how the custom module worked that we developed for them. If it existed it would write a row in a database table along with the email address of the person registering. It would then mark the redirect as used so the next time they logged in it wouldn't send them to the same page again. That's it! It would be great if all of this especially Steps 2, 6, and Bonus were combined in one module and easier to set up.
If someone wants to, let me know or I may if I find the time and one of our clients requires it. View the discussion thread.
0コメント