I installed the test script in much the same way as in the example: https://github.com/GoodCloud/django-ajax-uploader
It seems to start loading the file (javascript updates the name and size of the file), but the view gives me a 500 error with this message. I can not find anything on how to fix this.
S3ResponseError: S3ResponseError: 400 Bad Request <Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><RequestId>26E6EF8296A0E585</RequestId><HostId>F4QUOsVT4LxC+6OUP2lE1/9uPC77keOejyWs57GpS5kjvHXpun3U+81ntL8ZTgDa</HostId></Error>
I managed to upload the file in the shell using boto using the commands here: Upload a 0-byte file to Amazon S3
View:
from ajaxuploader.views import AjaxFileUploader from ajaxuploader.backends.s3 import S3UploadBackend import_uploader = AjaxFileUploader(backend=S3UploadBackend)
JavaScript:
var uploader = new qq.FileUploader({ action: "/ajax/profile-upload/", element: $('#file-uploader')[0], multiple: true, onComplete: function(id, fileName, responseJSON) { if(responseJSON.success) { alert("success!"); } else { alert("upload failed!"); } }, onAllComplete: function(uploads) {
template:
<div id="file-uploader"> <noscript> <p>Please enable JavaScript to use file uploader.</p> </noscript> </div>
I have s3 access variables in the settings.py file (they are called in ajaxuploader / backends / s3.py file):
AWS_ACCESS_KEY_ID = myAccessKey AWS_SECRET_ACCESS_KEY = mySecretKey AWS_BUCKET_NAME = bucketName
source share