#9396: FILE_UPLOAD_TEMP_DIR ignored on Windows? ---------------------------------------------------------------+------------ Reporter: spkane | Owner: nobody Status: new | Milestone: post-1.0 Component: Database layer (models, ORM) | Version: 1.0 Keywords: FILE_UPLOAD_TEMP_DIR, SuspiciousActivity, Windows | Stage: Unreviewed Has_patch: 1 | ---------------------------------------------------------------+------------ When running Django 1.0 on Windows XP, I am getting an error when uploaded a headshot (image), while adding an author from the Chapter 6 tutorial in the Django Apress book. The error is related to "SuspiciousActivity", however my FILE_UPLOAD_TEMP_DIR directory is set to 'c:\djcode\mysite\temp' which should be safe. The issue, based on the error message, however seems to be that it is actually trying to save the image into /tmp, which of course causes a problem on Windows. I was able to get this working for myself by patching django\db\models\fields\files.py.
I am a pretty new Python programmer and I realize that this patch is a hack, since I am forcing something to happen here and possibly over ridding a legitimate value. I tried to change the initial init from upload_to='' to upload_to=settings.FILE_UPLOAD_TEMP_DIR. However that didn't work, so it seems that the class is getting initialized with a value, but it is the wrong value, and I could not trace the code back any further. This patch works for me, but it would be nice to have a proper solution in the future. -- Ticket URL: <http://code.djangoproject.com/ticket/9396> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
