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

Comments

Projects
None yet
2 participants
@ghost
Copy link

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

This comment has been minimized.

Copy link
Collaborator

commented Jul 24, 2015

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

This comment has been minimized.

Copy link
Owner

commented Jul 25, 2015

foosel added a commit that referenced this issue Aug 10, 2015

Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
@foosel

This comment has been minimized.

Copy link
Owner

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

Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
(cherry picked from commit 4bb5be7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.