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

API - File upload not working #985

Closed
ghost opened this issue Jul 24, 2015 · 3 comments
Closed

API - File upload not working #985

ghost opened this issue Jul 24, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 24, 2015

Hello,

just switched from version 1.1.2 to 1.2.4 and an exception occur if I try to upload a file through the API.

2015-07-24 23:00:24,409 - tornado.application - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/tornado-4.0.1-py2.7-linux-armv6l.egg/tornado/http1connection.py", line 542, in _read_fixed_body
    yield gen.maybe_future(delegate.data_received(body))
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/tornado-4.0.1-py2.7-linux-armv6l.egg/tornado/httpserver.py", line 274, in data_received
    return self.delegate.data_received(chunk)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/tornado-4.0.1-py2.7-linux-armv6l.egg/tornado/web.py", line 1874, in data_received
    return self.handler.data_received(data)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/server/util/tornado.py", line 209, in data_received
    self._process_multipart_data(data)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/server/util/tornado.py", line 254, in _process_multipart_data
    self._on_request_body_finish()
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/server/util/tornado.py", line 369, in _on_request_body_finish
    self._new_body += p + b"\r\n"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
2015-07-24 23:00:44,116 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.178.22
@GitIssueBot
Copy link

Hi @moony871,

It looks like there is some information missing from your ticket that will be needed in order to process it properly. Please take a look at the Contribution Guidelines and the page How to file a bug report on the project wiki, which will tell you exactly what your ticket has to contain in order to be processable.

If you did not intend to report a bug, please take special note of the title format to use as described in the Contribution Guidelines.

I'm closing this one now as it is currently incomplete. Please feel free to comment here to request a reopen of this issue once you can provide all required information.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@foosel
Copy link
Member

foosel commented Jul 25, 2015 via email

foosel added a commit that referenced this issue Aug 10, 2015
Just don't set the content_type parameter in that case.

Fixes #985
@foosel
Copy link
Member

foosel commented Aug 11, 2015

Since you didn't provide the request you were using, the only thing I could do was make sure the code doesn't hiccup on unset fields in the multipart headers. I hope that solves it. Will be included in 1.2.5.

foosel added a commit that referenced this issue Aug 11, 2015
Just don't set the content_type parameter in that case.

Fixes #985
(cherry picked from commit 4bb5be7)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants