Opened 17 years ago

Closed 17 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

Description

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?

MOD_PYTHON ERROR
ProcessId:      7892
Interpreter:    '127.0.1.1'


ServerName:     '127.0.1.1'
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/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)


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

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

    result = object(arg)

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

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

    response = self.get_response(request)

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


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

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

    return self.nodelist.render(context)

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

  File "/usr/lib/python2.5/site-packages/django/template/__init__.py", 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/__init__.py", line 754, in render_node

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

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

    for d in (self.POST, self.GET):
  File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 70, in _get_post
    self._load_post_and_files()
  File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", 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/__init__.py", line 72, in parse_file_upload
    raw_message += '\r\n\r\n' + post_data

MemoryError

Change History (1)

comment:1 by James Bennett, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #2070.

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