Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

[6.0] Add ability to define MIME type for file upload #735

Open
SammyK opened this issue Jan 19, 2017 · 3 comments
Open

[6.0] Add ability to define MIME type for file upload #735

SammyK opened this issue Jan 19, 2017 · 3 comments
Milestone

Comments

@SammyK
Copy link
Contributor

SammyK commented Jan 19, 2017

In lieu of #731, we should add a parameter to the FacebookFile constructor for $mimeType. I'm thinking it should show up after $filePath and thus would be for v6.0 since it's a change to the API. But we could add it to the end of the constructor for v5.next.

And we could also add it to the Facebook::fileToUpload & Facebook::videoToUpload methods for both v6.0 and v5.next. Thoughts? :)

@yguedidi
Copy link
Contributor

I agree on the idea of allowing a user defined MIME type ;)

@yguedidi yguedidi added this to the 6.0.0 milestone Jun 24, 2017
@ryanml
Copy link
Contributor

ryanml commented Dec 4, 2017

@yguedidi if this is still desired I think I'd like to take this on :)

A couple of questions:

  1. I'm assuming this wouldn't allow an arbitrary mime type, rather it would be validated against the array of $mimetypes in the Mimetypes class under the Facebook\FileUpload namespace?

  2. Mimetypes are usually defined by a file's extension/the HTTP PUT request context. In the case a user passes a "video-like" mimetype for a .pdf or something like that, would an exception be thrown? Or would we be more forgiving and let that fail on its own (Probably the worse of two ideas)

Appreciate your time on this :) Any further specs you or @SammyK could give would be helpful, otherwise I can fill in the gaps and they can be further discussed on the PR. Thanks

@yguedidi
Copy link
Contributor

yguedidi commented Dec 4, 2017

As we now use HTTPlug, there must be a spec session on how to handle file upload with HTTPlug ;)
Check the possible Future work section in #641, there are lot to do with the HTTPlug integration

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants