criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 176 forks source link

Uploading photos / access to request lib's formData #87

Closed barry-johnson closed 8 years ago

barry-johnson commented 8 years ago

The library has worked great for some basic get/set API operations, however I noticed there wasn't an example of a recommended way to upload a file via fbgraph. Because it uses request, I thought I might make use of the technique here: https://github.com/request/request#multipartform-data-multipart-form-uploads (I need to capability illustrated in the "custom_file" item in the example). However, and I may be looking at the fbgraph library code incorrectly (admitted a brief review), but it appears fbgraph only packages up its params and doesn't provide access to formData.

Let me know if there is another intended way to handle file attachments with requests.

criso commented 8 years ago

I've never had to upload photos, but what you're saying makes sense and would need a patch

barry-johnson commented 8 years ago

Thanks for getting back to me and confirming my read of fbgraph. I am working around it for the time being by just calling request directly for the upload, which is not much of a bother. I just would have felt silly if I had just been missing some easy pass-through via fbgraph. I am going to close the issue, as it is resolved for my purposes. Thanks again.

criso commented 8 years ago

:+1: