Unanswered: File Upload to the server protected with OAuth
Unanswered: File Upload to the server protected with OAuth
Trying to upload a file to the server that requires a OAuth token in the header.
The code is similar to this example: http://dev.sencha.com/deploy/ext-4.0...file-upload.js but it appears that there is no way to add HTTP headers here, since for file upload it always uses HTML form submit and not AJAX, so headers cannot be changed/added...
From what I understand, current implementation of the form submission will always use HTML instead of Ajax when file upload is needed, so is there a method, event, property that we need to change to switch it to Ajax? If not, is there a way to get file contents and implement submission as a separate "custom" call?
In other words, here is the code for submit from the sample:
buttons: [
{ text: 'Save',
handler: function()
{ var form = this.up('form').getForm();
if(form.isValid())
{ form.submit(
{ url: 'file-upload.php',
waitMsg: 'Uploading your photo...',
success: function(fp, o)
{ msg('Success', 'Processed file "' + o.result.file + '" on the server');
} }); } } }
Adding "headers": "Test:test" will not work here once form has a field of the type file...
(Not sure I am very clear here about the problem...)