Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:36:16+00:00 2026-06-02T05:36:16+00:00

I want to make valums/file-uploader run with django upload, using it with model fields

  • 0

I want to make valums/file-uploader run with django upload, using it with model fields (FileField)

basic django model:

class Image(models.Model):
    user = models.ForeignKey(User)
    url = models.FileField(upload_to='%Y/%m/%d')

basic view, working with non ajax upload:

def ajax_upload(request):
    if request.method == 'POST':
        newfile = Image()
        newfile.user = request.user
        file_content = ContentFile(request.FILES['file'].read())
        file_name = request.FILES['file'].name
        newfile.url.save(file_name, file_content)
        results = {'url': newfile.url, 'id': newfile.id}
        return HttpResponse(json.dumps(results))
    raise Http404

The problem is that valums uploader does not put the files in “request” files, it put it in the POST, and django get it as a querydic.

Using it with the top code django says:

“Key ‘file’ not found in “

If i change:

file_content = ContentFile(request.POST)

django says:

expected read buffer, QueryDict found

I can make it work but i still want to hold on django’s native file upload, it’s much cleaner.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:36:18+00:00Added an answer on June 2, 2026 at 5:36 am

    Use request.body (or request.raw_post_data if older than 1.4)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want make datetimepicker in my project. Using jquery how it is possible? I
I have style sheet with a class name changebackgroundcolor i want make change in
Simplest case: You want to make a text file which says The MD5 hash
I want to make a PowerShell script that takes each file of my music
Hi there I want to make a function for me to able upload a
I want to make one thread that puts values to a queue when it
i want to find values in array according to alphabate and want to make
I want to make an hibernate querycount on a table. I have to values,
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.