@csrf_exempt
def document_ajax_upload(request):
print request.POST['qqfile']
return HttpResponse('{"success":true}')
我正在关注本教程:http://valums.com/ajax-upload/ 一旦它通过ajax上传,我应该能够得到图片。
这是我的HTML代码:
var uploader = new qq.FileUploader({
// pass the dom node (ex. $(selector)[0] for jQuery users)
element: document.getElementById('file-uploader'),
action: '/document/ajax_upload',
onComplete:function(id, filename, responseJSON){
$("#file-uploader").html("<b>File uploaded:</b> " + filename);
}
});
我只是希望能够打印出文件!!!
当我打印request.POST时,我明白了:
<QueryDict: {u'': [u')>0?'], u'\ufffd<c': [u'A>\x1f?\x01?\ufffd@\ufffdA\ufffdB\ufffdC\ufffdD\ufffdE\ufffdF\ufffdG\ufffdH\ufffdI\ufffdJ\ufffdK\ufffdL\ufffdM\ufffdN\ufffdO\ufffdP\ufffdQ\ufffdR\ufffdS\ufffdT\ufffdU\ufffdV\ufffdW\ufffdX\ufffdY\ufffdZ\ufffd[\ufffd\\\ufffd]\ufffd^\ufffd_\ufffd`\ufffda\ufffdb\ufffdd\x0fe#f5gIh[imj}k\ufffdl\ufffdm\ufffdn\ufffdo\ufffdp\ufffdr\x02s\x1et'], u'\x16I\x16l\x16\ufffd\x16\ufffd\x16\ufffd\x16\ufffd\x17\x1d\x17A\x17e\x17\ufffd\x17\ufffd\x17\ufffd\x17\ufffd\x18\x1b\x18@\x18e\x18\ufffd\x18\ufffd\x18\ufffd\x18\ufffd\x19 \x19E\x19k\x19\ufffd\x19\ufffd\x19\ufffd\x1a\x04\x1a*\x1aQ\x1aw\x1a\ufffd\x1a\ufffd\x1a\ufffd\x1b\x14\x1b': [u''], u'?\ufffd\ufffdi\ufffd{\x7f[C\ufffdN\ufffd n?K\ufffd_\x1a\ufffd\ufffd]v\ufffd\ufffd.W\x01\u02d0\ufffdQ\u06ac\u018ei\ufffdQ\ufffdl\ufffd\x07f': [u'\ufffd\u05ba>\ufffd\u015cS\ufffd\ufffda\u0630\ufffdg\ufffd \ufffdJ\ufffdr\u022c\ufffd\ufffde\u024a\u04e9\ufffd\u0244\ufffd\ufffd\ufffde\ufffd\ufffd\ufffdx\ufffd#\ufffd\ufffdFz\u06ce\ufffd\\\ufffdb\ufffd\x14\ufffd\ufffd \x11U\ufffd|\u05ab\ufffd\ufffdNZ\ufffdZ\ufffdZ\ufffdX\x10\x0ff\ufffd\ufffd\x19\ufffd\ufffd\ufffd\x11:\x04\ufffdO\ufffdu\ufffd\ufffdQV\ufffdP\ufffd\x03\ufffd\ufffd \ufffdQ\ufffd\ufffd \ufffd\ufffd\ufffd3\ua3e3\ufffd\ufffd( \ufffd\ufffd\ufffd \ufffd\ufffd\\ EI\ufffdZS\ufffd\ufffd\ufffd\ufffd\n\ufffd\x10\x13]h\ufffd]vE\ufffd\x10\ufffd\ufffd\ufffd\\Fc\x04\ufffdK9\ufffd\ufffd\ufffd\u0179\x0b\x05\ufffd\u07d8\ufffdh\x13\ufffd\x1disGK\x18\ufffd\ufffd\x13\ufffd\ufffd#\ufffd\ufffd\ufffdg\ufffd#\x1d\ufffd\x0b\ufffd\x1a/\ufffd)\ufffd'], u'\ufffd\ufffd\ufffd\x06\ufffdv\ufffd\ufffdV\ufffd\u01e58\ufffd\ufffd\ufffd\x1a\ufffd\ufffd\ufffd\ufffd\ufffdn\ufffd\ufffdR\ufffd\u01297\ufffd\ufffd\ufffd\x1c\ufffd\ufffd\ufffd\x02\ufffdu\ufffd\ufffd\\\ufffd\u042dD\ufffd\ufffd\ufffd-\ufffd\ufffd\ufffd\x16\ufffd\ufffd\ufffd\x00\ufffdu\ufffd\ufffd`\ufffd\u05b2K\ufffd\xb38\ufffd\ufffd\ufffd%\ufffd\ufffd\ufffd\x13\ufffd\ufffd\ufffd\x01\ufffdy\ufffd\ufffdh\ufffd\ufffdY\ufffd\u0479J\ufffd\xba': [u''], u"\ufffd<'<e<\ufffd<\ufffd": [u'"=a=\ufffd=\ufffd> >`>\ufffd>\ufffd?!?a?\ufffd?\ufffd@#@d@\ufffd@\ufffdA)AjA\ufffdA\ufffdB0BrB\ufffdB\ufffdC:C}C\ufffdD\x03DGD\ufffdD\ufffdE\x12EUE\ufffdE\ufffdF"FgF\ufffdF\ufffdG5G{G\ufffdH\x05HKH\ufffdH\ufffdI\x1dIcI\ufffdI\ufffdJ7J}J\ufffdK\x0cKSK\ufffdK\ufffdL*LrL\ufffdM\x02MJM\ufffdM\ufffdN%NnN\ufffdO\x00OIO\ufffdO\ufffdP\'PqP\ufffdQ\x06QPQ\ufffdQ\ufffdR1R|R\ufffdS\x13S_S\ufffdS\ufffdTBT\ufffdT\ufffdU(UuU\ufffdV\x0fV\\V\ufffdV\ufffdWDW\ufffdW\ufffdX/X}X\ufffdY\x1aYiY\ufffdZ\x07ZVZ\ufffdZ\ufffd[E[\ufffd[\ufffd\\5\\\ufffd\\\ufffd]\']x]\ufffd^\x1a^l^\ufffd_\x0f_a_\ufffd`\x05`W`\ufffd`\ufffdaOa\ufffda\ufffdbIb\ufffdb\ufffdcCc\ufffdc\ufffdd@d\ufffdd\ufffde=e\ufffde\ufffdf=f\ufffdf\ufffdg=g\ufffdg\ufffdh?h\ufffdh\ufffdiCi\ufffdi\ufffdjHj\ufffdj\ufffdkOk\ufffdk\ufffdlWl\ufffdm\x08m`m\ufffdn\x12nkn\ufffdo\x1eoxo\ufffdp p\ufffdp\ufffdq:q\ufffdq\ufffdrKr\ufffds\x01s]s\ufffdt\x14tpt\ufffdu(u\ufffdu\ufffdv>v\ufffdv\ufffdwVw\ufffdx\x11xnx\ufffdy*y\ufffdy\ufffdzFz\ufffd{\x04{c{\ufffd|!|\ufffd|\ufffd}A}\ufffd~\x01~b~\ufffd\x7f#\x7f\ufffd\x7f\ufffdG\ufffd\ufffd\ufffd\n\ufffdk\ufffd\u03420\ufffd\ufffd\ufffd\ufffdW\ufffd\ufffd\ufffd\x1d\ufffd\ufffd\ufffd\ufffdG\ufffd\ufffd\ufffd\x0e\ufffdr\ufffd\u05c7'], u'_8`9a': [u'bEcPdZeefogzh\ufffdi\ufffdj\ufffdk\ufffdl\ufffdm\ufffdn\ufffdo\ufffdp\ufffdq\ufffdr\ufffds\ufffdu\tv\x1bw,x=yNz]{m||}\ufffd~\ufffd\x7f\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd~\ufffds\ufffdg\ufffdZ\ufffdN\ufffdA\ufffd3\ufffd'], u"\ufffd'\ufffd(\ufffd)\ufffd*\ufffd ~,d-K.0/\x16/\ufffd0\ufffd1\ufffd2\ufffd3\ufffd4}5a6D7": [u''], u')<': [u''], u'\n{X\u6d34WI\u0662\ufffd\nQ\x1c\ufffd\ufffdU\u05d2\ufffd,\ufffdLl\u079b$N\x0ec\ufffdA\x1dg\ufffd\ufffd4\ufffd\ufffd\ufffd\x18d\ufffdT\ufffd7-\ufffd\x16\ufffdi\ufffdj\ufffd\x00W\u03f1f\ufffdH\x18p\u03aa\ufffd$\ufffd]!\x1eKC\x11\ufffd\ufffd\r\ufffd\ufffd\x03\ufffd\ufffd\ufffdt\ufffd\ufffd\ufffd\ufffd\x1c\u04c3r\u0345T`\ufffd\ufffd\ufffd\x03\ufffd9 \ufffd8\ufffdb\ufffd\ufffd\ufffd': [u''], u'*\ufffdsS\x1a\ufffd\x0e\x15\ufffd:\ufffd\x07\ufffdf,N\x87\'\x05y\ufffdc\ufffd[\ufffd\ufffd\ufffd\ufffd-\ufffdcq*G\x1c*\ufffdF\u03b4\u06ac\ufffd\ufffd\x06\ufffdGn\ufffdH\ufffdw\'\ufffd\ufffdi\x07\ufffd\x1a\ufffdg\x7f(Z\ufffd\ufffdak\ufffd\ufffd\x02\ufffd\x000\ufffd\ufffd{0~cU\ufffd\u040c\ufffd\n:L\ufffd\ufffd\ufffdt\ufffdG\x08\ufffd9\ufffd\ufffd \ufffd\ufffd\ufffdN\ufffd\x00S%\ufffd\x15#\ufffd\ufffddNkv\ufffdE\t-\u051ea\ufffd\ufffd\x1dn\x0b\x05\u06ae\ufffd\ufffd\ufffd\ufffdB\ufffd7>R\ufffd\ufffd\x02\u0591c\ufffd\x1f\x15\ufffd\x05\ufffd\x003\ufffd\ufffdVx\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x00\'\x10\x01\x00\x02\x01\x03\x01\t\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x00\x11!1AQa\x10 0q\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x00\x08\x01\x01\x00\x01?!\ufffd\ufffd\ufffd\ufffd:\ufffdK8g\ufffd0js\ufffd\x00"~]\x1dL\ufffd\ufffdv\ufffd\ufffd:\ufffd \ufffd': [u''], u'\ufffd\ufffd\x14@\x16\x06\ufffd6z,\ufffd\u0482d\r': [u'\ufffd\ufffdTV\ufffd\ufffd\ufffdq\ufffd#\ufffdfn'], u'\ufffd?*\ufffd\ufffdb\ufffdb\ufffda\ufffd\ufffd\ufffde\ufffd\ufffd\ufffd\ufffd(}r\ufffd2\x1c\ufffd6\ufffd\x07\ufffd\ufffd\ufffdt\ufffd^\x04\ufffdt\ufffdu \ufffd{4M~\ufffdM\x0b\x02\ufffdm\ufffd~ZM\ufffd>\u07e4~\ufffd\ufffd\ufffd\u05ce.\ufffdx\ufffd\ufffd\ufffd\ufffd\ufffd': [u'a\ufffd\x18\ufffd\ufffd\x1a\ufffd\ufffd,m\ufffd\ufffd\ufffd\x13\ufffd3\ufffd\ufffd*\ufffd2\ufffd\ufffd?\ufffd\x13%\ufffd\ufffd\ufffdT\x13\ufffd\U0005dc81\ufffd\x18\ufffd\x15\ufffd\ufffdX\ufffd\ufffd\ufffd\ufffd8I\ufffdt\ufffd\ufffd\ufffd\x1f\ufffdb\u0176B\ufffdO\x1c\ufffd\x19\nz\ufffd\u06bd\ufffd\ufffd\ufffd\x1a\ufffd>\ufffd\ufffd{\ufffdhX\ufffdN\ufffd\ufffdX'], u'\ufffd\u0733\fd\ufffdA\ufffd\ufffd88\r\ufffd\ufffd\r\ufffd2\ufffd\ufffd\ufffd\ufffd\t\ufffd}B1Hz'\ufffdF\ufffd": [u''], u'\ufffd4\ufffdA\ufffdN\ufffd]\ufffdn\ufffd\ufffd\ufffd\ufffd\xb2\ufffd\ufffd\ufffd\ufffd\ufffd\x0b\ufffd*\ufffdG\ufffde\u0282\u02df\u033b\ufffd\ufffd\ufffd\ufffd\ufffd\x04\ufffd\x15\ufffd#\ufffd-\ufffd5\ufffd<\ufffdC\ufffdI\ufffdN\ufffdT\ufffdY\ufffd]\ufffdb\ufffdg\ufffdl\ufffdr\ufffdz\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x05\ufffd\x10\ufffd\x18\ufffd\x1c\ufffd\x19\ufffd\x0b\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd}\ufffdR\ufffd%\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdq\ufffdC\ufffd\x16\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\\\ufffd.\ufffd\ufffd\x00\x00\x00V\x01.\x01\ufffd\x02\ufffd\x03^\x04)\x05\x07\x05\ufffd\x06\ufffd\x07\ufffd\x08\ufffd\t\ufffd\n\ufffd\x0b\ufffd\x0c\ufffd\x0e \x0f>\x10l\x11\ufffd\x12\ufffd\x13\ufffd\x152\x16g\x17\ufffd\x18\ufffd\x1a\x05\x1b:\x1co\x1d\ufffd\x1e\ufffd\x1f\ufffd!\x1d"?#X$l%y': [u''], u'\ufffdR\ufffd~}\ufffd\x0c\x016\ufffd\ufffd\ufffd[(8\ufffd\x0fd m\x12\ufffd\ufffd*\u0147\ufffd(\ufffd\n\u072e}\ufffdo\x11-O]T0\ufffd\ufffd\ufffd~%\ufffd7\ufffd\ufffd\x07\ufffdz\ufffd\ufffd\ufffd\ufffd\x06\ufffdt\ufffd\x00\ufffd\ufffd\x00(\x10\x01\x00\x02\x01\x03\x03\x03\x04\x03\x01\x00\x00\x00\x00\x00\x00\x01\x00\x11!1AQaq\ufffd\x10 \ufffd\ufffd\ufffd\ufffd\ufffd0\ufffd\ufffd\ufffd\ufffd\ufffd\x00\x08\x01\x01\x00\x01?\x10w\ufffd\ufffd7\x02\ufffdK`4\ufffd\ufffd\ufffdN\ufffd?\ufffd\x16\ufffd\ufffdTv\x18x\x1euk\x1f\ufffdh\ufffd\ufffd\ufffd>\x101kA/\ufffd\ufffd\x1a>\ufffd\x12Q\u0126\ufffdx\'@\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd|O\ufffd\ufffd\ufffdW\ufffdG\ufffd\ufffd\ufffd42\ufffdv\ufffd\x1d\ufffdp\x04\x17\ufffd\ufffd:\x1c\x01\ufffd\x0f1\ufffdn\ufffdt\ufffd\ufffdt\ufffd\ufffd\ufffd|?$\u0479\ufffd\x15w!\ufffd\x08\ufffdK-\x07\ufffd\ufffdKz/\ufffd\ufffdHk5\ufffd\ufffd\ufffd\ufffd7\ufffd\ufffd\ufffdB8\ufffd\u0407\ufffd.\ufffd\x13\ufffd\x00\x17\ufffd\ufffd\ufffdB\x15\x0b\ufffd#n\ufffdQ_VhF\ufffd\ufffd}\n\ufffd\x02a\x13\ufffd\ufffd\ufffdiv(A\ufffd\x1a#\ufffd\ufffd\ufffd\ufffd1\ufffd\ufffdw~M\x1c\ufffd\x1e\ufffd\ufffd\ufffd#\ufffd])W, \ufffd\ufffd\x1a\ufffd\ufffd\x12\ufffd\ufffd\x1d-\ufffd\ufffdy\x0e\ufffd\ufffd\x0b\x02\u0561}ba\ufffd\u04b3\ufffd," \ufffd\x17\ufffd\x16 :"2\ufffd\xc5\x10Eh\ufffd"\ufffd\x0e4y\ufffdnkY\ufffd\ufffd\ufffd\ufffd': [u'\ufffd\ufffd\ufffd\ufffd\ufffd*9\ufffds7i\x0c\ufffdC\ufffdw\r\ufffd\x7f'], u"\ufffd'\x18'I'z'\ufffd'\ufffd(\r(?(q(\ufffd(\ufffd)\x06)8)k)\ufffd)\ufffd*\x02*5*h*\ufffd*\ufffd \x02 6 i \ufffd \ufffd,\x05,9,n,\ufffd,\ufffd-\x0c-A-v-\ufffd-\ufffd.\x16.L.\ufffd.\ufffd.\ufffd/$/Z/\ufffd/\ufffd/\ufffd050l0\ufffd0\ufffd1\x121J1\ufffd1\ufffd1\ufffd2*2c2\ufffd2\ufffd3\r3F3\x7f3\ufffd3\ufffd4 4e4\ufffd4\ufffd5\x135M5\ufffd5\ufffd5\ufffd676r6\ufffd6\ufffd7$7`7\ufffd7\ufffd8\x148P8\ufffd8\ufffd9\x059B9\x7f9\ufffd9\ufffd:6:t:\ufffd:\ufffd": [u''], u"\x06\ufffd\ufffd\ufffd8q\ufffd\x1c\ufffd?xR8O\x07$\ufffd\r\ufffdEW\ufffd$\ufffd\ufffd\ufffd\x13\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdaNTr\ufffd*\ufffd\ufffd\x1a[\ufffdc\ufffd\x02\ufffd\x7f\ufffd\ufffd\ufffd$~\ufffd\n\ufffd\ufffd}\ufffd\ufffd\xa3O\ufffdb\r\ufffd\ufffd\ufffd4\ufffd\x04\ufffdM0N\ufffd\ufffd\ufffd\x0e\ufffd\ufffdCq\ufffd\ufffdeu\ufffd\ufffd\ufffd\x00$\x11\x01\x00\x02\x01\x03\x03\x05\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x11!01A Q\ufffd\x10aq\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x00\x08\x01\x02\x01\x01?\x10Z\ufffd\u02d7\x07@s\x00\ufffd\x04A\x12\ufffd.\ufffd\ufffda\ufffd\ufffd\ufffd\x10'": [u''], u'\ufffd\x18\x08\x01\ufffd\ufffdD<\ufffd\ufffd5\ufffd\ufffd': [u''], u'\x17\ufffd\x18k\x19\x07\x19\ufffd\x1aG\x1a\ufffd\x1b\ufffd\x1c9\x1c\ufffd\x1d\ufffd\x1e<\x1e\ufffd\x1f\ufffd ? \ufffd!\ufffd"G"\ufffd#\ufffd$b%\x1a%\ufffd': [u''], u'CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality ': [u' 87\n\ufffd\ufffd\x00C\x00\x04\x03\x03\x04\x03\x03\x04\x04\x03\x04\x05\x04\x04\x05\x06\n\x07\x06\x06\x06\x06\r\t\n\x08\n\x0f\r\x10\x10\x0f\r\x0f\x0e\x11\x13\x18\x14\x11\x12\x17\x12\x0e\x0f\x15\x1c\x15\x17\x19\x19\x1b\x1b\x1b\x10\x14\x1d\x1f\x1d\x1a\x1f\x18\x1a\x1b\x1a\ufffd\ufffd\x00C\x01\x04\x05\x05\x06\x05\x06\x0c\x07\x07\x0c\x1a\x11\x0f\x11\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\ufffd\ufffd\x00\x11\x08\x00\ufffd\x00\ufffd\x03\x01"\x00\x02\x11\x01\x03\x11\x01\ufffd\ufffd\x00\x1c\x00\x00\x02\x01\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x06\x02\x03\x05\x07\x08\x04\ufffd\ufffd\x00\x18\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\ufffd\ufffd\x00\x0c\x03\x01\x00\x02\x10\x03\x10\x00\x00\x01\ufffd19W.\u02f2\ufffd\ufffd|\ufffdyf9\ufffd\ufffd\ufffdw\ufffd'], u'\ufffd\ufffd\ufffd\ufffdw\ufffd\ufffd\u07ed\ufffd M\ufffd\ufffd\ufffd\u0632\ufffd:\ufffd2 )\ufffd\ufffd\x13(\ufffd\r\x05\x7f\x1e\ufffd\x17u\u025f\ufffd\ufffd\ufffd\x16\u055e\ufffd\ufffd\ufffdZkM\ufffdfP[\ufffd>EY\ufffd2\x13\ufffd\ufffd\x1c2\ufffdZ\ufffd\ufffd\x1d#A\ufffd\ufffdc\ufffdJ\ufffd\ufffd\ufffd\x1d\x1e\u9bc1\ufffd7\ufffd\ufffd"\x18\ufffd\ufffd\ufffd\x1a\x0ci\ufffdq\x0e\ufffd\ufffd\ufffd\ufffd\u010e?A0\ufffd\ufffdJ\ufffd\ufffd\ufffd^\ufffd\ufffd\u02d8\u02fd\x7f\ufffd\u0144\ufffd\x0fw\ufffd\ufffd\ufffd[\ufffd\ufffd\ufffdU\ufffdB\ufffd\ufffd\ufffd\ufffd[\x1b\ufffdT\ufffd\ufffd\ufffdn': [u'\ufffd\ufffd\x13\ufffdr\ufffd\x19\ufffd^\x1fp\ufffd\ufffd_a\ufffd\ufffdxY\ufffdT(\u06a3\ufffd\ufffd\ufffd\ufffd\ufffd\x19i\ufffda<\x10\ufffd{\ufffdS\ufffdQ\ufffd#qz\ufffd\ufffd[\ufffd\x16s\x11m\'\ufffd\x1a\x19\ufffd\ufffdu\ufffd!KX\ufffdi\ufffd\ufffd\ufffd\ufffd\ufffd7\ufffd\ufffd-i\x1d\u046e\ufffd)e\t\ufffdd\ufffd\x07\ufffd\ufffd\xdaL\x15\ufffdJ \ufffd\ufffd\u0734\x03\x0c\x07\ufffd"\x03\ufffd#\u016cV\x14\ufffd[\ufffd\ufffdL"v\ufffd\ufffdP\ufffdf\ufffd\ufffd\ue435\ufffd'], u'-': [u''], u'^\ufffd\ufffdV\ufffd\ufffd\x1f%\ufffd\r\ufffdc\ufffdO\ufffdg\ufffd\ufffd\ufffd\ufffd\ufffd0\u07b9\ufffd\x1f4\x07/\x14\ufffd1\ufffdJl\ufffd#\x15"E\ufffd\x13tN~c\x1b3\x1a\ufffd\ufffdE\ufffd\u021b\t\x7f\x1d\ufffd\x0eN\ufffd\ufffd\ufffdH^\ufffd\ufffd\ufffd<}\ufffd!e\t\ufffd\ufffd\x1f"j\ufffdx\xbbNE\ufffd\ufffdT\ufffd\ufffdvWk\u02ac\ufffd\x00\ufffdmc`\ufffd\x12\ufffd\ufffd\x13\x0f\ufffd\ufffdZ\ufffd\x19\ufffdE\x1b\ufffd\ufffd\ufffdB\x06xI\ufffd4\ufffd\ufffd\ufffd\x13$\ufffd\x14m\ufffd\ufffd{\ufffdaO\ufffd\ufffdL\ufffd^\ufffd\ufffdr\ufffdN': [u''], u'8\x078\ufffd9\ufffd:\ufffd': [u''], u'\ufffd\ufffd\ufffd.\ufffd\ufffd\ufffd!\ufffd\ufffd\ufffd\x15\ufffd\ufffd\ufffd\n\ufffd\ufffd\ufffd\ufffd\ufffdz\ufffd\ufffd\ufffdp\ufffd\ufffd\ufffdg\ufffd\ufffd\ufffd_\ufffd\ufffd\ufffdX\ufffd\ufffd\ufffdQ\ufffd\ufffd\ufffdK\ufffd\ufffd\ufffdF\ufffd\ufffd\ufffdA\u01ff\ufffd': [u'\u023c\ufffd:\u0279\ufffd8\u02b7\ufffd6\u02f6\ufffd5\u0335\ufffd5\u0375\ufffd6\u03b6\ufffd7\u03f8\ufffd9\u043a\ufffd<\u047e\ufffd?\ufffd\ufffd\ufffdD\ufffd\ufffd\ufffdI\ufffd\ufffd\ufffdN\ufffd\ufffd\ufffdU\ufffd\ufffd\ufffd\\\ufffd\ufffd\ufffdd\ufffd\ufffd\ufffdl\ufffd\ufffd\ufffdv\ufffd\ufffd\u06c0\ufffd\x05\u070a\ufffd\x10\u0756\ufffd\x1c\u07a2\ufffd)\u07ef\ufffd6\ufffd\ufffdD\ufffd\ufffd\ufffdS\ufffd\ufffd\ufffdc\ufffd\ufffd\ufffds\ufffd\ufffd\ufffd\ufffd\r\ufffd\ufffd\x1f\ufffd\ufffd2\ufffd\ufffdF\ufffd\ufffd\ufffd[\ufffd\ufffd\ufffdp\ufffd\ufffd\ufffd\ufffd\x11\ufffd\ufffd(\ufffd\ufffd@\ufffd\ufffd\ufffdX\ufffd\ufffd\ufffdr\ufffd\ufffd\ufffd\ufffd\x19\ufffd\ufffd4\ufffd\ufffd\ufffdP\ufffd\ufffd\ufffdm\ufffd\ufffd\ufffd\ufffd\ufffd\x19\ufffd\ufffd\ufffd8\ufffd\ufffd\ufffdW\ufffd\ufffd\ufffdw\ufffd\x07\ufffd\ufffd\ufffd)\ufffd\ufffd\ufffdK\ufffd\ufffd\ufffdm\ufffd\ufffdpara\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02ff\x00\x00\ufffd\x00\x00\rY\x00\x00\x13\ufffd\x00\x00\n\ufffdvcgt\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x01\x00\x00\x02\x00\x00\x00V\x01.\x01\ufffd\x02\ufffd\x03^\x04)\x05\x07\x05\ufffd\x06\ufffd\x07\ufffd\x08\ufffd\t\ufffd\n\ufffd\x0c\x05\r'], u'\ufffd\u04bd\ufffd\u0723tY\x1a\ufffd]\ufffd\x19)\x08\ufffd\ufffd\r\ufffd5\ufffd': [u''], u'\x11\x00\x01\x03\x04\x01\x02\x07\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x02\x11\x03\x12!01\x13Q\x04\x10"#ABaP\ufffd\ufffd\x00\x08\x01\x02\x01\x01?\x01\ufffd|\ufffdr\x11tj{\ufffd\x1c.\x14j\ufffd7\ufffdW\ufffd\x1fT\ufffd\x00\x10\ufffd\ufffd0\ufffd\x06t\ufffd*\ufffd\ufffd`\ufffd]0\ufffd4\x03\x05\x072\x17\ufffd\x12P\x14\ufffd\ufffdS\ufffd0\ufffd\ufffd': [u'\ufffd\x1f\ufffd\x038)\ufffd\xa4\ufffdJGt\ufffd@\ufffd\ufffdM\ufffd\ufffd\x1c\ufffd4J{\ufffd\ufffdT\ufffd}\u07c8\ufffd\ufffd?\ufffd\ufffd\x00@\x10\x00\x01\x03\x01\x04\x05\x08\x08\x04\x04\x07\x00\x00\x00\x00\x00\x01\x00\x02\x03\x11\x04\x12!1"2Qaq\x10\x13#0AB\ufffd\ufffd\x14 3Rbr\ufffd\ufffd\x05$4\ufffd@\ufffd\ufffd\ufffd\x15C\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x00\x08\x01\x01\x00\x06?\x02B2\x0c\ufffd\x1e\ufffdV61\ufffd_\ufffd\ufffd\ufffdx LM\x1f\x16W\ufffdmL\x1f6\ufffd\ufffdV)\x18\ufffd\ufffd\ufffd\x12r\n\ufffd!\ufffd\x1d\x1fS\x16}V\ufffd\ufffdWAj\ufffd\x0f\ufffd\ufffdu\u04f69\ufffd\ufffd\ufffdA\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x00n\ufffd\ufffd\ufffd(\ufffd\ufffdk\ufffd\ufffd?\ufffdf\ufffd\ufffd\x0e\x1e\ufffdl\x7f\ufffd:\ufffdp\ufffdS\ufffd=\x7f\ufffdF\ufffd\x1d\ufffd\ufffd\ufffdj'], u'\ufffd\ufffd\ufffd\x13\ufffd\x1ay\x07\ufffdN': [u"\ufffdx\x04\ufffdk\ufffdo\x1b[\x1a\ufffd\x06\ufffd\x17\\\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd7'\ufffdp\ufffdpH\ufffd\x00\\\ufffdP\ufffd$\ufffdi\ufffd\ufffd\ufffd \ufffd\ufffd2bK\ufffd\ufffd6S Dz\ufffdm\ufffd\ufffd\ufffd\ufffdk5\ufffd\ufffd\x1a.\x03c\ufffd\x16\ufffd\ufffd_\ufffdH\x0cP\ufffd2\ufffdkM\ufffdX\ufffdV\ufffd\ufffdFH\ufffdMwE\ufffd"], u'gH\ufffd\ufffd\u06f4\x13\ufffdM\ufffd\x1cx\ufffd\ufffdo}\x07\ufffd/\ufffd\x0eSph\ufffdN9\ufffdg\ufffd0/R !pT\x05\ufffdXJ\ufffd\ufffd\ufffd(\ufffd5\ufffdE\u015a\x00\nG\ufffdi\ufffd\u04ce\ufffdq\ufffd\ufffd#"\ufffd\ufffdcH\ufffd\x14\ufffdDN\ufffd\ufffd8t\ufffd\x02\n\ufffd\ufffd\x0b{\ufffd\x01\x11\x1d\x1fB\ufffd\ufffd\ufffd^\ufffd^b\ufffd\ufffd\ufffd\ufffd\ufffd-\ufffd\ufffd\x03\ufffd\ufffd\ufffd\nF\x06\x01\ufffd\ufffd\ufffd\x07sG\ufffd\ufffd\ufffd\ufffdjz\ufffd\ufffd, k\ufffd\x1f\ufffd\r\ufffd\x18\ufffd\x13\x01\x1e\ufffd\ufffd\x11h\ufffd\x1cV\ufffdH\x1d\ufffdl\ufffd\ufffd\x1b\ufffd[*\ufffda?0d*\ufffd': [u''], u'\x0eN\n\x1bvR\n': [u''], u'$Y\x04O\ufffd\u04b4h\ufffd\x0b\ufffd\ufffdFqi\n\ufffd*\x13E\ufffd\u03da\x15q\ufffd\\x).': [u"\ufffd\u072bsW\ufffd\ufffd\x07gL\ufffd\ufffd!\ufffd\ufffdX?~\ufffd\ufffd\ufffd\x1e\u0738\ufffd\ufffd\ufffdN\ufffd(\ufffd\x11a4'\x11\ufffd\x0bE\ufffd\ufffdX\x1f\ufffd\ufffdkM\ufffd)\ufffdty\ufffd\u05cc\ufffdId\ufffd\ufffd\x00\ufffd\x15}\x15\ufffd\ufffdB\ufffd'\ufffd\ufffd\ufffdhI3|AW\ufffdo\ufffd\ufffd\ufffd\x7fug\ufffd\x07\ufffdh\u0753\ufffd\ufffd\ufffd\x12\ufffd\ufffdY\ufffdV<yu\u0375Y\ufffd-5(O\x1f\ufffd\ufffd\ufffd\ufffd\uf367\x1a4\ufffd\ufffd8\ufffd\x01{F\ufffd\ufffdUKbw\ufffd\u04f3\ufffdx\x14\ufffd%\ufffd\ufffd\ufffdt\ufffdi[\x85If\ufffds\ufffdc\ufffd\ufffdT\ufffdF)\x1f~\ufffd#\ufffd\ufffd\ufffd\x12\x0ei\ufffd9\x1e\ufffd\ufffd\u024b\\\x14\ufffdH)\x1b\u02b9\ufffd:\ufffd\x0fP\ufffd#\u024f \ufffd6\ufffd\ufffdG\ufffdq\ufffd\x00\ufffd\\\ufffdc\x15\ufffd1\ufffd\x04X\ufffd%\ufffda\ufffd\ufffd<\ufffd7\ufffdQ\u0470\ufffd,l\ufffdB\ufffd\ufffd:9,\ufffd9"], u"U'\x16'\ufffd(\ufffd)g*1*\ufffd \ufffd,\ufffd-a...\ufffd/\ufffd0\ufffd1l2A3\x183\ufffd4\ufffd5\ufffd6\ufffd7o8U9A:1": [u''], u'\ufffd*RS\ufffd\u049d\x02t\t\ufffd\'H\ufffd"\x00\ufffdC\ufffd\x02\ufffdi\ufffd\ufffd\x1d\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x04\x18\ufffdh(n \ufffd\x06>""N\ufffd\ufffd\ufffd|cYrh\ufffd\ufffd\ufffd\x12\ufffd\n\ufffd\ufffd\ufffdw\x1ed6\x19\ufffd\x0f^\ufffd\ufffdb\ufffd\ufffd\'I\ufffd/\ufffd\x7fT\ufffd\ufffd\ufffd\ufffd\x18\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\x16C\ufffd\ufffd\ufffd#4\ufffd\x00\ufffd\x016y\ufffd*%\ufffd\ufffd\x07\ufffd\x08O-\ufffd?\ufffd8\r\x01u\ufffd\rA$\ufffd\ufffd\ufffd|\ufffd\x01\ufffd\x0f\x1d\ufffd~!\ufffda\ufffdX\ufffd\ufffd\x0eS7\ufffd\ufffd\u0449\uf81d\u01e2@\ufffdE\ufffd<\ufffd4\ufffd M\u06bd\x14\ufffdu\ufffdq\ufffdMx\u07cd2\ufffd\ufffd\ufffd\ufffd|\ufffd\ufffd\x02Uq\ufffdt^\u0478u\x1d[\ufffd\x13<L\ufffd\x1e\ufffd\x19\ufffdn\ufffdJ\ufffd\ufffd\x00\ufffd\x00\ufffdt7\ufffd\ufffd\ufffd\ufffd`\ufffd5 \ufffd\ufffd \ufffdj\x1f\ufffd\ufffd\x11\ufffd0>\ufffd\u036a\x7f\ufffd\ufffd\x0c\x13\ufffd\x1aN\ufffd>\ufffd\ufffdd\ufffd\ufffd\r\x17I\ufffd\ufffd\x1a_`\x7f`J': [u'\ufffd\ufffd\ufffd{Kl\x03.\ufffd!\ufffd\ufffd\ufffd\ufffdE\ufffd\ufffd%\ufffd\ufffd#p\ufffdy\ufffd\ufffd]\ufffd(\x10,kx\ufffd\t\u060f\ufffdA\ufffd\ufffd\ufffd\x08\u05f9\ufffd\ufffd\x085dz\ufffdaV\ufffdhq\x1c\ufffd\ufffdj\ufffd\ufffdCE\ufffd[\x0b@p\ufffd\ufffd\ufffd\ufffd\x15\ufffd\ufffdJ\ufffdEx\ufffd\nF\x1b\tS\ufffd\ufffd\ufffd5\ufffd\x13\r\ufffd#.\x1c\ufffd\ufffd\ufffd>\ufffd\ufffd3\x7f\ufffd\ufffd,\ufffdd\ufffdP\ufffd\ufffd\u0191\x19\ufffd\ufffd\ufffdk\ufffd)\x1a\ufffd8\ufffdn=\x19\ufffd\x11\ufffd\ufffd\ufffd\ufffd\r{\ufffd\ufffd\ufffd?\ufffd\ufffd\ufffdP'], u'G\ufffd': [u"\ufffd\x00\ufffd\ufffd\ufffd>6{\ufffd\ufffd\ufffd\ufffd\ufffd\x1c\ufffd\ufffd\ufffdwFG\ufffd:\ufffd\ufffde!\ufffd\ufffd!\ufffd`1\x05\ufffd[\ufffds/<TR\ufffd\ufffd\ufffdS\ufffd\ufffd\ufffd\ufffd<xG\ufffd\ufffd'\ufffdP]\ufffd\x00\ufffd\ufffd\ufffd\ufffd\ufffd}\ufffdu\x00\x00\x00\x00bbb\x04\xdb \ufffd_\ufffd\x13X\u06fe\t\x1fl\ufffdH-jc|\ufffd{\\\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdx\ufffd\ufffd\ufffds\ufffdu\ufffdb\ufffd\x03\x10\ufffd4\ufffd\x18\ufffd\r9\ufffd\ufffd\x1c}D\ufffd"], u'\ufffd\ufffd\ufffd\x04\ufffdi\ufffd\u03893\ufffd\ufffd\ufffd\ufffd\ufffdd\ufffd\u028b0\ufffd\ufffd\ufffd\ufffd\ufffdc\ufffd\u028d1\ufffd\ufffd\ufffd\ufffd\ufffdf\ufffd\u038f6\ufffd\ufffd\ufffd\x06\ufffdn\ufffd\u0591?\ufffd\ufffd\ufffd\x11\ufffdz\ufffd\ufffdM\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd_\ufffd\u02564\ufffd\ufffd\ufffd\n\ufffdu\ufffd\ufffdL\ufffd\ufffd\ufffd$\ufffd\ufffd\ufffd\ufffd\ufffdh\ufffd\u055bB\ufffd\ufffd\ufffd\x1c\ufffd\ufffd\ufffd\ufffd\ufffdd\ufffd\u049e@\ufffd\ufffd\ufffd\x1d\ufffd\ufffd\ufffd\ufffd\ufffdi\ufffd\u0621G\ufffd\ufffd\ufffd': [u'']}>
答案 0 :(得分:1)
文件未存储在request.POST
中,它们存储在request.FILES
。
答案 1 :(得分:1)
看起来请求实际上只包含图像数据(请求具有内容类型“application / octetstream”)。所以我会尝试以下方法:
from django.core.files.uploadedfile import SimpleUploadedFile
def document_ajax_upload(request):
file = SimpleUploadedFile(request.META['HTTP_X_FILE_NAME'],
request.raw_post_data)
print file # or whatever else you wish to do with the file
return HttpResponse('{"success":true}')