-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for other extensions except CSV for uploaded files #79
Comments
Here is another fix for this - db55e8c which uses file extension to detect file format. I'm not sure if using mimetype is a good idea. |
@kmanaseryan Please, feel free to close this issue as fixed if you believe so. |
@anuveyatsu there is lib which does job for us: https://www.npmjs.com/package/mime-types. If the extensions are known and they are few, we can actually hardcode them in a list and get the format from there, but if they are going to be arbitrary extensions then I think it worth to use the lib. |
@kmanaseryan yes and we're actually using that lib already https://github.com/datopian/data.js/blob/master/package.json#L53 and https://github.com/datopian/data.js/blob/b03836de6b3291173d2c37901456ba5f5aeb2baf/src/index.js#L369 I'm not sure about that lib because it might be just mapping file extension to mime-type. |
@anuveyatsu cool, haven't noticed that, so we can use it then.
I think the lib is more safe than we do it on ourselves, becuase two different mime types can have one extension, so this lib I believe handles that. |
Currently in the calls dedicated for uploaded files the csv format is hardcoded. We need to make it so the format will be automatically generated from the mime type.
Acceptance criteria
Tasks
The text was updated successfully, but these errors were encountered: