Forum OpenACS Development: Re: File Storage: View vs. Download

Collapse
Posted by Malte Sussdorff on
Okay, here is what I propose (and what I'm actually doing for a client). Everywhere I see "cr_write_content" I will have a redirect to download the file using file.vuh (unless it does more than just return a file, obviously).

For file.vuh to work with this the following changes are needed:

a) It needs to work both with revision_id as well as item_id. At least this would be my understanding that you can call /file/1353 and it does not matter if 1353 is an item or a revision.

b) I set the content-disposition header in file.vuh, although this requires an additional DB query

For the client I will not use cr_write_content though but use NGINX and X-Accel_redirect to serve the physical file directly from the harddisk (content-repository-content-files), bypassing AOLserver. I will write this up in my NGINX documentation.

I won't touch view.vuh in OpenACS, just for the client.

If you feel the above change to file.vuh (and image.vuh ?) requires a TIP, let me know, otherwise I would commit after the weekend when I'm done to HEAD (or should this to go to 5.4 ?)

Collapse
Posted by Malte Sussdorff on
Okay, one more..

Some pages (e.g. like attachments/www/download/index.vuh) do an internal permission check and then return the file using cr_write_content. I was wondering if it makes sense in general to redirect those to file.vuh as well and add something to file.vuh so we can bypass permission checks.