Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to set a 'response-content-disposition' param/header when uploading a file #82

Open
dylanwolff opened this issue Dec 6, 2018 · 3 comments

Comments

@dylanwolff
Copy link
Contributor

Per a client request (see: https://3.basecamp.com/3810878/buckets/9505978/todos/1362900706) it would be useful to be able to set a response-content-disposition param when uploading a file via an upload field, as a means of controlling whether the file is rendered inline or as an attachment when a user clicks a link to access it (by setting the Content-Disposition header appropriately for the file on S3).

See also some internal discussion here: https://icelab.slack.com/archives/C2BT34RK7/p1541993717013500

@makenosound
Copy link
Contributor

So the use case here is that:

  • For a certain type of file
  • In a certain upload context

We want to change the content-disposition we set? There are a few different ways we could handle, so just want to check that both those statements above are true or not. Think we could potentially make it:

  • A global configuration for formalist (which we can adjust per instance of an entire form)
  • A field-level configuration so that if you had two upload fields in a single form you could set different content disposition rules for each.

@dylanwolff
Copy link
Contributor Author

I mentioned to the client that we could do this either at a global level for particular types of files (which I thought might be the simpler option) or potentially also on a per-upload-context basis.

The client's response was:

Thanks for that information - I think if we could define it just for PDF's (which will be the most used file) that would be great

So if the global configuration option is going to be much simpler to implement perhaps that will suffice for now? We could potentially then add the ability to set this at the field level at a later date.

@makenosound
Copy link
Contributor

Yeah, we could perhaps make it a tiered thing.

  1. Some default configuration (per file type)
  2. Ability to adjust that global configuration when instance is created
  3. Ability to override the global configuration per upload_field instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants