clarin-dspace icon indicating copy to clipboard operation
clarin-dspace copied to clipboard

Usage of local.bitstream.redirectToURL

Open kosarko opened this issue 1 year ago • 1 comments

@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?

kosarko avatar Dec 07 '23 13:12 kosarko

  1. The data pump just copy that metadata value from v5 to v7
  2. ~~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."

milanmajchrak avatar Apr 30 '24 11:04 milanmajchrak