Django file upload failing occasionally

后端 未结 4 755
挽巷
挽巷 2020-12-29 13:40

I am trying to port my first Django 1.0.2 application to run on OSX/Leopard with Apache + mod_python 3.3.1 + python 2.6.1 (all running in 64-bit mode) and I am experiencing

相关标签:
4条回答
  • 2020-12-29 14:04

    How large is the file? It may take long enough to upload that the upload script times out, so try increasing the execution time for that script.

    0 讨论(0)
  • 2020-12-29 14:11

    I would chase down the exception value

    Client read error (Timeout?)
    

    this seems odd enough. Try reading this thread

    0 讨论(0)
  • 2020-12-29 14:23

    Using mod_wsgi made the problem go away for Firefox.

    Limiting my research to an interaction problem between Apache and Safari, I stumbled upon this bug report for Apache https://bugs.webkit.org/show_bug.cgi?id=5760 that describes something very similar to what is happening and it is apparently still open. Reading this gave me the idea to try and disable the keepalive and, though I need to test it more extensively, it seems the problem is gone.

    A simple:

    BrowserMatch "Safari" nokeepalive

    in the Apache configuration did the trick.

    0 讨论(0)
  • 2020-12-29 14:31

    Long time unanswered here, but having experienced this myself and tried a few things to resolve it. It seems in my case, it happened if someone canceled a download (or lost connection) during an upload.

    You can try this yourself to see if this is what is causing the "IOError: request data read error" for you: upload a large enough file that you can unplug your ethernet cable from your computer or router. Wait a bit and see if you get the error. I do everytime!

    0 讨论(0)
提交回复
热议问题