addListener(req.upload, 'progress', function(evt){self.progressHandler(evt);});
addListener(req.upload, 'load', function(evt){self.uploadCompleteHandler(evt);});
- req.open("PUT", this.uploadUrl + '/' + file.name);
+ req.open("PUT", this.uploadUrl); // + '/' + file.name);
req.setRequestHeader("Content-Type", file.type);
+ req.setRequestHeader("X-File-Name", file.name);
addListener(reader, 'load', function(evt){req.sendAsBinary(evt.target.result);});
reader.readAsBinaryString(file);
};
--- /dev/null
+##parameters=REQUEST, RESPONSE
+
+from Products.Plinn.utils import makeValidId
+
+factory = context.PUT_factory
+typ = REQUEST.get_header('content-type', None)
+body = REQUEST.get('BODY', '')
+
+id = makeValidId(context, name)
+ob = factory(id, typ, body)
+
+return RESPONSE
// <!--
(function(){
var lb = document.getElementById('lightbox');
- var uploadUrl = absolute_url();
+ var uploadUrl = absolute_url() + '/jsupload';
new Lightbox(lb);
new DDFileUploader(lb, uploadUrl);
})();