Open mortomanos opened 4 years ago
Found it myself: the swagger API documentation is wrong, it states that the form data field needs to be named "Upload file", but instead it needs to be "assets" Could you please change the documentation?
Thanks for the info.
Example in ruby:
` require 'net/http' require 'json'
@user = 'pi' @pass = 'pi' @url_files = 'http://192.168.0.2:3000/api/files'
def upload_file(file)
uri = URI(@url_files)
Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Post.new(uri.request_uri) request.basic_auth(@user, @pass) form_data = [["assets", File.open('/tmp/' + file)]] request.set_form(form_data, 'multipart/form-data') response = http.request(request) puts response.body end end
upload_file('file.jpg') `
I cannot get the POST to /files (asset file upload) working on the open source server. I tried to use the swagger API "try out" feature as well as the curl command line, but both did not work. I also looked at the code, but found nothing useful why it is not working.
I only get a 500 server error with no specific error message (Internal error occured!).