Page MenuHomePhabricator

URL Param to pass to Paste to download paste instead of viewing it
Closed, ResolvedPublic

Description

I would like to have a url param like ?download=true that could be appended to a Paste view endpoint to just download the file. I'm not sure if this exists in some capacity, not just linking to the raw paste (which is locked to a particular version, not the most recent version).

We use pastes to store versioned bootstrap scripts (for setting up dev env, etc) and it could turn the process of "go here, click this button, save as..." into "run wget phabricator/P1 -O bootstrap.sh && ./bootstrap.sh".

Event Timeline

ox updated the task description. (Show Details)
ox added a project: Paste.
ox added a subscriber: ox.

You don't actually care about download/view (i.e., the Content-Disposition of the response), you just want a URL which shows the current contents, right?

That is, if we linked to /paste/123/view/ in the UI instead of directly to the file, and that endpoint just did a redirect to the file, that would cover this use case?