Opened 11 years ago

Closed 11 years ago

#6602 closed (duplicate)

upload huge file more than physcial memory size

Reported by: avain <avainitri@…> Owned by: nobody
Component: HTTP handling Version: 0.95
Severity: Keywords: http upload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I test the upload function with Django. In my application, the upload file size is about 2G. I try to upload 500MB, and the system will response below. The System monitor tells the physcial memory(1G) + swap memory(1G) are run out. I dig the code and think that the variable-post_data will receive all the data and keep in memory and then get the result- memoryerror. I need the function- upload huge file more than physcial memory size. Will the future Django version will support the function?

ProcessId:      7892
Interpreter:    ''

ServerName:     ''
DocumentRoot:   '/var/www/'

URI:            '/imagecity/upload/'

Location:       '/imagecity'
Directory:      None
Filename:       '/var/www/imagecity'
PathInfo:       '/upload/'

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/", line 1128, in _execute_target

    result = object(arg)

  File "/usr/lib/python2.5/site-packages/django/core/handlers/", line 178, in handler
    return ModPythonHandler()(req)

  File "/usr/lib/python2.5/site-packages/django/core/handlers/", line 151, in __call__

    response = self.get_response(request)

  File "/usr/lib/python2.5/site-packages/django/core/handlers/", line 111, in get_response
    return debug.technical_500_response(request, *sys.exc_info())

  File "/usr/lib/python2.5/site-packages/django/views/", line 151, in technical_500_response
    return HttpResponseServerError(t.render(c), mimetype='text/html')

  File "/usr/lib/python2.5/site-packages/django/template/", line 181, in render

    return self.nodelist.render(context)

  File "/usr/lib/python2.5/site-packages/django/template/", line 736, in render
    bits.append(self.render_node(node, context))

  File "/usr/lib/python2.5/site-packages/django/template/", line 764, in render_node

    raise wrapped

TemplateSyntaxError: Caught an exception while rendering: 

Original Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/django/template/", line 754, in render_node

    result = node.render(context)
  File "/usr/lib/python2.5/site-packages/django/template/", line 790, in render
    return self.filter_expression.resolve(context)
  File "/usr/lib/python2.5/site-packages/django/template/", line 582, in resolve

    obj = resolve_variable(self.var, context)
  File "/usr/lib/python2.5/site-packages/django/template/", line 671, in resolve_variable
    current = current[bits[0]]
  File "/usr/lib/python2.5/site-packages/django/http/", line 36, in __getitem__

    for d in (self.POST, self.GET):
  File "/usr/lib/python2.5/site-packages/django/core/handlers/", line 70, in _get_post
  File "/usr/lib/python2.5/site-packages/django/core/handlers/", line 51, in _load_post_and_files

    self._post, self._files = http.parse_file_upload(self._req.headers_in, self.raw_post_data)
  File "/usr/lib/python2.5/site-packages/django/http/", line 72, in parse_file_upload
    raw_message += '\r\n\r\n' + post_data


Change History (1)

comment:1 Changed 11 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Duplicate of #2070.

Note: See TracTickets for help on using tickets.
Back to Top