Skip to content

API: /my_files/{sub_path} returns relative path #56

@moi90

Description

@moi90

I'm using /my_files/{sub_path} to see if a file is already uploaded (in order to not upload it again), in preparation for a subsequent import (file_import/{project_id}).

When I actually upload the file, the returned filename is absolute (e.g. /tmp/ecotaxa_user.XXX/XXX/LOKI_46-24hours_01.zip and file_import/{project_id} works.

However, /my_files/{sub_path} returns a path relative to the user directory:

{
  'path': 'XXX',
  'entries': [{'name': 'LOKI_46-24hours_01.zip', 'type': 'F', 'size': 0, 'mtime': '2023-02-16 19:06:50.901954'}]
}

Therefore, file_import/{project_id} does not work, because it assumes absolute paths or paths relative to the common import directory.

No such file or directory: '/ecotaxa_import_area/XXX/LOKI_46-24hours_01.zip'

I think for the /my_files/{sub_path} endpoint to be useful, it should return absolute paths.

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