Skip to content
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

Can't open files unless there's an extension #102

Closed
OscarGodson opened this issue Jan 26, 2015 · 1 comment
Closed

Can't open files unless there's an extension #102

OscarGodson opened this issue Jan 26, 2015 · 1 comment

Comments

@OscarGodson
Copy link

This makes it sort of a pain because file uploads don't have extensions. They look something like /var/folders/fm/vyvfk53d2b5gf63m7dnv3gqc0000gn/T/33ba4e6ef6ded7f0369f587f17090af4. So, to get around this, I have to rename it to the name it was uploaded as before giving it to lwip. I believe you should be able to use something like: https://github.com/rosszurowski/mime-sniffer/ and read it based on the actual file type, not the extension of the file.

@EyalAr
Copy link
Owner

EyalAr commented Jan 26, 2015

Detecting mime types is not in the scope of lwip.
It's very application-specific. Not all apps will use lwip to process images uploaded to a web server.

You could use the module you suggested to detect the type of image uploaded to your server, and thus give lwip the correct type when opening the file.

What lwip could do, is detect the image type automatically (unrelated to mime types). And indeed there's an issue for this (#87), and a PR (#96). It will be available in the next version.

@EyalAr EyalAr closed this as completed Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants