Skip to content

files without extensions #4

Closed
icodeforlove opened this Issue Dec 15, 2011 · 1 comment

2 participants

@icodeforlove

I used this twitpic library previously and it worked like a charm, but due to some changes we needed to read from images without file extensions. Currently the way that mime is working it defaults to application/octet-stream, which causes twitpic to respond with

{"errors":[{"code":400,"message":"Bad Request. Media not included in POST payload."}]}

It would be pretty awesome if you added a way to manually override/provide the mimetype like this:

twitpic.upload({path: "/tmp/887060a0b1cf04a2ea96e91a04c320cc", mimeType: 'image/gif'}, function (data) {
});

i got it working by just adding the following:

mimeType = opts.mimeType || mime.lookup(opts.path);
@meltingice

Implemented, thanks for the suggestion!

@meltingice meltingice closed this Dec 15, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.