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

Node-box file upload with absolute internet url #10

Open
Shahbazgit opened this issue Jul 13, 2015 · 2 comments
Open

Node-box file upload with absolute internet url #10

Shahbazgit opened this issue Jul 13, 2015 · 2 comments

Comments

@Shahbazgit
Copy link

Hi,

I want to upload a file via absolute internet url like 'http://mydomain//myfile.jpg'
but i am getting an error 'unhandled stream error in pipe'

Can you please guide me how to achieve this? How can i upload a file present over the internet.

Waiting for your response,
Shahbaz

@srt32
Copy link
Contributor

srt32 commented Jul 13, 2015

Are you using the Files.upload function (found here: https://github.com/Skycatch/node-box/blob/master/lib/index.js#L133)?

That function makes a multipart POST to https://upload.box.com/api/2.0/files/content and Box's docs expect a file. I don't believe Box's API supports fetching files from arbitrary URL's.

EDIT: from the same docs referenced above, a manual cURL request to this endpoint would look like the below:

curl https://upload.box.com/api/2.0/files/content \
  -H "Authorization: Bearer ACCESS_TOKEN" -X POST \
  -F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
  -F [email protected]

@srt32
Copy link
Contributor

srt32 commented Aug 28, 2015

ping @Shahbazgit, did you figure out your issue or did my earlier response (#10 (comment)) help at all?

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