Monday, April 27, 2015

Re: model.FileField

Hi James,

Thanks for suggesting me the page at location I visited that page and as you suggested, there was no need of database in between, However, I noted that we have to manually write the file as shown in snippet given below(copied from url suggested by you)

def handle_uploaded_file(f):      with open('some/file/name.txt', 'wb+') as destination:          for chunk in f.chunks():              destination.write(chunk)

So, I mean, Isn't there any way through which this file writing operation takes places automatically in django. Moreover, you note that here, filepath is hard-coded. I want that it file uploaded by user, must be copied at MEDIA_ROOT variable set in of project.

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment