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

  • Home
  • SEARCH
  • 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 8822031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:59:54+00:00 2026-06-14T05:59:54+00:00

I am trying to do this in Django (async upload a canvas as an

  • 0

I am trying to do this in Django (async upload a canvas as an image file). I’m using (a slightly modified version of) the javascript found in the demo, which rolls its own XHRHttpRequest, but I fail to find any evidence of the upload on the server side.

The canvas data is being extracted like this:

img_data = canvas.toDataURL('image/jpeg').replace("data:image/jpeg;base64,", "");

This is the xhr header:

xhr.setRequestHeader('content-type', 'multipart/form-data; boundary=multipartformboundary1352769538973');

This is the POST content:

--multipartformboundary1352769538973
Content-Disposition: form-data; name="user_file"; filename="test.jpeg"
Content-Type: application/octet-stream

/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAUDAwUHD...snipping image data...
AJRRRQAUtJS018gA/9k=
--multipartformboundary1352769538973
Content-Disposition: form-data; name="username"


--multipartformboundary1352769538973
Content-Disposition: form-data; name="challenge"


--multipartformboundary1352769538973
Content-Disposition: form-data; name="galleryPath"


--multipartformboundary1352769538973--

When I ask Django to show me the request object it sees, this is what I get:

<WSGIRequest
path:/samlite/save_frame,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'username': [u''], u'challenge': [u''], u'galleryPath': [u'']}>,
COOKIES:{},
META:{'ARCHFLAGS': '-arch i386',
 'Apple_PubSub_Socket_Render': '/tmp/launch-wL0OpX/Render',
 'Apple_Ubiquity_Message': '/tmp/launch-ox20mG/Apple_Ubiquity_Message',
 'COMMAND_MODE': 'unix2003',
 'CONTENT_LENGTH': '34323',
 'CONTENT_TYPE': 'multipart/form-data; boundary=multipartformboundary1352769538973',
 'DISPLAY': '/tmp/launch-KzsfWx/org.x:0',
 'DJANGO_SETTINGS_MODULE': 'simsam.settings',
 'DYLD_LIBRARY_PATH': '/Applications/bitnami-djangostack/apps/django/lib/python2.7/site-packages:/Applications/bitnami-djangostack/apps/django/lib/python2.7/site-packages:/Applications/bitnami-djangostack/python/lib:/Applications/bitnami-djangostack/mysql/lib:/Applications/bitnami-djangostack/sqlite/lib:/Applications/bitnami-djangostack/apache2/lib:/Applications/bitnami-djangostack/common/lib:',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HOME': '/Users/chris',
 'HTTP_ACCEPT': 'text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en,en-US;q=0.9,ja;q=0.8,fr;q=0.7,de;q=0.6,es;q=0.5,it;q=0.4,pt;q=0.3,pt-PT;q=0.2,nl;q=0.1',
 'HTTP_CONNECTION': 'Keep-Alive',
 'HTTP_HOST': 'localhost:8000',
 'HTTP_REFERER': 'http://localhost:8000/samlite/',
 'HTTP_USER_AGENT': 'Opera/9.80 (Macintosh; Intel Mac OS X 10.7.5) Presto/2.12.388 Version/12.10',
 'LANG': 'en_US.UTF-8',
 ...less interesting stuff snipped...
}>

So the normal POST key/value pairs are getting through, but based on this, I expected to see a response.FILES dictionary. Can anyone point me in the right direction?

  • 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-14T05:59:55+00:00Added an answer on June 14, 2026 at 5:59 am

    Django doesn’t include the FILES dictionary in the repr() output. Try accessing it anyway:

    print request.FILES
    

    In the Django source, you can see that path, GET, POST, COOKIES, and META are included, but not FILES.

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

Sidebar

Related Questions

I`m trying to upload files to Django with SWFUpload. Found this article Django with
I'm trying to get Django running on GAE using this tutorial . When I
I'm trying to create a POST request using angular.js to this Django view. class
Trying to install this ipython version. infact there's a django-starter project which uses buildout
I am trying to build something very similar to like this using django activity
I'm trying to dumpdata into a file, and keep getting this error: d:\django\mysite>manage.py dumpdata
I am new to Django and was trying this code in a tutorial. But
I'm getting into django and this is getting me a headache. I'm trying to
I'm trying to make a custom view in Django admin. I'm reading from this
this is my first question. I'm trying to execute a SQL query in django

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.