nosdav / pastebin

NosDAV pastebin
https://nosdav.github.io/pastebin/
MIT License
8 stars 1 forks source link

Improve MIME type handling for supported file extensions #7

Closed melvincarvalho closed 1 year ago

melvincarvalho commented 1 year ago

Currently, the code only handles plain text files. To improve the versatility of the application, it would be beneficial to add support for more MIME types, such as .txt, .ttl, and .json.

Proposed changes:

  1. Create a function called getMimeType that takes a filename as a parameter and returns the corresponding MIME type.
  2. Update the loadFile and save methods to use the getMimeType function to determine the appropriate MIME type based on the file extension.
  3. This enhancement would make the application more flexible and robust when handling different file types.