-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
backendBackend related issueBackend related issuefrontendFrontend related issueFrontend related issue
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backendBackend related issueBackend related issuefrontendFrontend related issueFrontend related issue