提问:django上传文件问题

本人写了一个django上传文件的接口,在本地使用postman调试时没有问题,代码部署至服务器之后接收文件出现如下错误。 Internal Server Error: /api/analysis/fuzzy_query Traceback (most recent call last): File "/home/daslab/.local/lib/python3.6/site-packages/django/http/request.py", line 355, in read return self._stream.read(args, *kwargs) File "/home/daslab/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 40, in read result = self.buffer + self._read_limited(size - len(self.buffer)) File "/home/daslab/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 28, in _read_limited result = self.stream.read(size) File "/home/daslab/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 40, in read result = self.buffer + self._read_limited(size - len(self.buffer)) File "/home/daslab/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 28, in _read_limited result = self.stream.read(size) File "/usr/lib/python3.6/socket.py", line 586, in readinto return self._sock.recv_into(b) ConnectionResetError: [Errno 104] Connection reset by peer

代码如下: if request.method == 'POST': print('qqq') file_obj = request.FILES.get('file', None)

评论 0