mirror of
https://github.com/RD17/ambar.git
synced 2026-04-25 07:25:55 +03:00
[GH-ISSUE #78] Fresh Install: Cannot POST /api/files/Default #77
Labels
No labels
$$ Paid Support
bug
bug
enhancement
help wanted
invalid
pull-request
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ambar#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dwenschhof on GitHub (Sep 28, 2017).
Original GitHub issue: https://github.com/RD17/ambar/issues/78
Hi all,
I did a fresh install and have Ambar running at http://10.0.1.9:80. Looking through the API docs, I tried to PUT my test.txt file using (test.txt file exists in my current directory):
curl -X POST http://10.0.1.9:80/api/files/Default/test.txt -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -F file=@test.txt
And I get the response:
Cannot POST /api/files/Default/test.txt
So, then I checked to see what Sources exist using:
curl -X GET http://10.0.1.9:80/api/sources
and I receive an empty set:
[]
Is the reason I am getting the "Cannot POST" error due to no sources existing? If so, I can not find anywhere that documents how to create a new source or endpoint? How is this done?
Thanks in advance.
@sochix commented on GitHub (Sep 29, 2017):
Hello @dwenschhof ! Did you have authentication enabled on you Ambar instance?
@dwenschhof commented on GitHub (Sep 29, 2017):
Hi @sochix , thanks for your response! I currently have "auth": "none" in my config.json. Does this need to have a different value for me to do a POST?
Thanks again.
@proteusos commented on GitHub (Oct 2, 2017):
it's the same problem i have.
curl -X POST \ http://MYIP/api/files/Testsource/test.pdf \ -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ -F file=@test.pdf
curl: (6) Could not resolve host:
curl: (26) couldn't open file "test.pdf"
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: multipart
curl: (6) Could not resolve host: boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
curl: (6) Could not resolve host: \
by the way...is it possible to select or name a tag by uploading a file with the gui-uploader?
thanks for help
@sochix commented on GitHub (Oct 13, 2017):
Hi! It's error in our documentation.
Use
api/files/uiupload/test.pdfHere is sample python code
@proteusos commented on GitHub (Oct 15, 2017):
thanks...the code is working, but where can i paste the path for the file. Or do i need to read the file with python first? Where u paste 'TEST FILE CONTENT' i can only save a string. The curl command in your doc is working now...thanks for that.
Question:
Can i create a tag or something else, when i upload files?
@sochix commented on GitHub (Nov 21, 2017):
@proteusos as for now not
@proteusos commented on GitHub (Nov 24, 2017):
@sochix thanks for your response
it's working now. Your blog describes, that i can hand over a ":sourceId" to the POST request. this could be Dropbox or in the example "books". So that i have a better structure, if i upload files via the rest api. So the standard tag/source is ":uiupload". That would be great, if you can implement this, or is it still possible?
https://blog.ambar.cloud/ambar-use-case-integrated-parse-and-search-solution/