clarin-dspace
clarin-dspace copied to clipboard
Usage of local.bitstream.redirectToURL
@milanmajchrak @vidiecan
This field (local.bitstream.redirectToURL
) was originally used to provide an alternative/faster way to provide files to users. The need for that was mostly replaced by using X-Sendfile (https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/).
In https://github.com/ufal/clarin-dspace/blob/8a6ba5c98547942d7115b74cf4978e0b29ca50e4/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/BitstreamReader.java#L443-L446 when a bitstream is accessed we check for this md field. If it is there then https://github.com/ufal/clarin-dspace/blob/8a6ba5c98547942d7115b74cf4978e0b29ca50e4/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/BitstreamReader.java#L821-L825 a redirect is sent (instead of dspace sending bytes read from storage).
In v7 this field is used differently (https://github.com/dataquest-dev/DSpace/wiki/Developing-backend#configure-big-file-limit); so:
- pingback #1045 (which tries to list these sort of changes)
- what does the data pump do with the existing values (this is bitstream metadata in v5)
- is it kept after the file has been uploaded? What happens if I upload multiple files this way; does the item keep only the latest path? From the wiki it seems this is now item level metadata?
- The data pump just copy that metadata value from v5 to v7
- ~~Some refactoring is needed, after refactoring the big upload file will looks like this:~~
- ~~bigfile input field will be moved to the
Upload
step (file path, file description; with upload button)~~ - ~~bigfile Item's metadata won't be deleted after upload~~
- ~~this input field will be allowed only for admin~~
- ~~this approach allows the admin to upload more big files~~
- ~~
redirectToURL
metadata is bitstream's level metadata, not item's~~
After update:
- The Item's
redirectToUrl
metadata is removed after every upload, that means you can upload whatever file you want - The cfg property which determines whether the file is removed after upload, was set to false, meaning "do not delete that file."