Skip to content

Add function to upload file #12

@ymarcon

Description

@ymarcon

There is a need for sending large data chunks to the server (ML):
https://datashield.discourse.group/t/how-to-pass-models-between-data-scientists-and-nodes-hospitals/440

Instead of working around the current API by serializing the data chunk and passing it as function parameter, the proposal is to add the ability to upload a file from the R/DS client to the R/DS server. It is the responsibility of the server-side function loading analyzing the uploaded file to ensure it is not malicious.

Function definition

The function signature would be:

datashield.upload(conns, source, destination = NULL)

Where:

  • conns is the list of DS connections
  • source is the path to the local (client) file to upload
  • destination is the path to the destination, relative to the R server session's work directory. It omitted, the destination is the source's file name.

Examples:

datashield.upload(conns, 'someData.rds')
# subfolders are automatically created when needed
datashield.upload(conns, 'someData.rds', 'myfolder/data.rds')

The following would fail because destination is not a subfolder of the R server session's workdir:

datashield.upload(conns, 'someData.rds', '/myfolder/data.rds')
datashield.upload(conns, 'someData.rds', '../myfolder/data.rds')

A subsequent function call will make use of the uploaded file:

datashield.assign.expr(conns, symbol = "someData", expr = quote(loadMyData('someData.rds')))

DataSHIELD node settings

The data manager should be able to disable this file upload feature at the DataSHIELD profile level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions