Search

Here’s the situation I’m in: I’m using the Unique Upload Field on a website and the client has addressed the concern that if he changes and uploads a new PDF any links to that PDF will be incorrect.

What I’m wondering, as a possible solution, would be to auto-trigger downloads based on a URL. So, for example, if someone went to website.com/article-title/download/ it would automatically trigger the download of the correct PDF based on the one in the datasource, which would be the most current.

This way, if he changes the PDF the link remains the exact same even though the file is completely different and has a new name.

Is this somehow possible? Obviously I’d have to make the necessary pages for downloading but I’m not sure how I would trigger that download. I’m hoping to avoid things like javascript if possible.

Off the top of my head: Meta Refresh

One option I’ve seen is to use PHP, but unless I’m mistaken you can’t mix PHP in with an XSLT template in Symphony?

You can always write a DS/Event with your custom PHP and attach it to your page.

I’ll keep that one in mind, sounds like it might be a good option.

However… My client has decided it’s not a priority as it doesn’t stand between us and launch. We might come back to it after the site goes live.

Another option I gave him was to just have dedicated download pages that he could use to link to.

I created an event for this more than 2 years ago. You´ll probably need to rewrite it to get it working, I don´t even know for which Symphony version I created it.

See http://gist.github.com/496477 for the Force Download event.

Sweet! I’ll let my client know that we have this as an option now.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details