Issue
I'm not using a Model for this form, I know I can set the upload_to parameter inside a Model File Field, but seems not possible from the Form.
When I set the FileField the file is uploaded to the MEDIA_ROOT I setup on my settings. Although, I would like the file uploaded to /folder. Is it possible directly from the Form File Field or I must move the file manually?
Solution
You will have to process the file manually from request.FILES['formfieldname']
, this should provide a clear description for both cases (using the FileField in your model or manual handling from the request):
https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/#basic-file-uploads
Answered By - HassenPy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.