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

The "POST" document service doesn't specify how to upload the file #360

Open
cosmo0 opened this issue Jul 26, 2024 · 3 comments
Open

The "POST" document service doesn't specify how to upload the file #360

cosmo0 opened this issue Jul 26, 2024 · 3 comments

Comments

@cosmo0
Copy link

cosmo0 commented Jul 26, 2024

How should I upload the file? If I upload using application/octet-stream as it seems the spec says (see Swagger), I don't have the filename:

curl --location 'https://.../documents' \
        --header 'Content-Type: application/octet-stream' \
        --header 'Authorization: Bearer xxxx' \
        --data 'my_file.pdf'

If I upload it using multipart/form-data it doesn't respect the spec, and the field name is not specified anyway.

@GeorgDangl
Copy link
Member

GeorgDangl commented Jul 29, 2024

That one is actually described in the foundation API: https://github.com/BuildingSMART/foundation-API/tree/v1.0?tab=readme-ov-file#19-binary-file-uploads

@cosmo0
Copy link
Author

cosmo0 commented Jul 29, 2024

Wrong URL ( https://github.com/BuildingSMART/foundation-API/tree/v1.0?tab=readme-ov-file#19-binary-file-uploads ) but ok thanks!

Maybe put a link back to Foundation on the BCF API spec?

@GeorgDangl
Copy link
Member

Ha, yeah, I pasted the wrong url there, sorry😀

The foundation API is referenced at the top of the README, here: https://github.com/buildingSMART/BCF-API?tab=readme-ov-file#11-opencde-foundation-api

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