Skip to content

Adding Mimetype reading and display #11

@aaw3

Description

@aaw3

When file information is retrieved from the backend, various functions will be run to get specific info about the file.
One example is getting the mime type.

Backend

using python-magic:

import magic

def get_mime_type(file_path):
    mime = magic.Magic(mime=True)
    return mime.from_file(file_path)

We can read the file header and determine the file type and if the file information is retrieved frequently, can be stored in the Redis database.

This information should be returned in the file information requests.
This way, if the file is trying to be opened in the web browser, the appropriate editor or viewer can be used.
The mime function will also determine what the value of image_path will be, such as a generic icon or a image/video thumbnail

Frontend

Different cases based on generic file types should be implemented for text, document, and image files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend related issuefrontendFrontend related issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions