Skip to content

upload size limit #43

@pdurbin

Description

@pdurbin

For now this is a placeholder issue. Today @landreev @scolapasta and I were talking about how in practical terms, files are limited to 2 GB when uploading to Dataverse via SWORD because getMaxUploadSize returns an int.

Below is the code from https://github.com/IQSS/dataverse/blob/v5.9/src/main/java/edu/harvard/iq/dataverse/api/datadeposit/SwordConfigurationImpl.java#L123-L146

To summarize:

  • When the system limit is not set, the SWORD upload is unlimited. However, it's very unlikely that anyone runs Dataverse in production with no size limit.
  • When the system limit is over 2 GB, we set the SWORD upload limit to 2 GB. This is probably a common case.
  • When the system limit is set and less than 2 GB, we set the SWORD upload limit to that value.

@Override
public int getMaxUploadSize() {
    
    int unlimited = -1;
    /* It doesn't look like we can determine which store will be used here, so we'll go with the default
     * (It looks like the collection or study involved is available where this method is called, but the SwordConfiguration.getMaxUploadSize()
     * doesn't allow a parameter)
     */ 
    Long maxUploadInBytes = systemConfig.getMaxFileUploadSizeForStore("default");

    if (maxUploadInBytes == null){
        // (a) No setting, return unlimited           
        return unlimited;      
    
    }else if (maxUploadInBytes > Integer.MAX_VALUE){
        // (b) setting returns the limit of int, return max int value  (BUG)
        return Integer.MAX_VALUE;
        
    }else{            
        // (c) Return the setting as an int
        return maxUploadInBytes.intValue();

    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions