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

Upload pdf by API #63

Closed
davidfungf opened this issue May 5, 2024 · 3 comments
Closed

Upload pdf by API #63

davidfungf opened this issue May 5, 2024 · 3 comments
Labels
question Further information is requested

Comments

@davidfungf
Copy link

I want to upload a pdf file by the API (POST https://x.x.x.x/api/documents/) using the following curl command. But it returned 401 unauthorized.

curl --location 'https://xxx.app.github.dev/api/documents/' \ --header 'Content-Type: multipart/form-data' \ --form '=@"/C:/Users/R008128.pdf"'

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

401 Unauthorized

Expected/desired behavior

OS and Version?

Azure cloud

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@sinedied
Copy link
Contributor

sinedied commented May 6, 2024

From you URL I understand that you're trying to send the file to the server running locally in your Codespaces?

First, can you try running the curl command locally in your Codespaces terminal, using a format like this:

curl -X POST -F "[email protected]" http://localhost:7071/api/documents

Note that you have to set the file key otherwise it won't work

@davidfungf
Copy link
Author

Thank you! I uploaded the document successfully.

@sinedied
Copy link
Contributor

sinedied commented May 6, 2024

Good to hear 🙂

@sinedied sinedied closed this as completed May 6, 2024
@sinedied sinedied added the question Further information is requested label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants