We have been using Valum's file uploader on the pages of our site served as HTTP, with no problems. We now want to use it on our HTTPS registration page, to allow people to upload a profile pic for their account. The documentation Valum's file uploader says it works with HTTPS, but it seems to be making the AJAX request via HTTP and we're getting the following errors in the console:
Is there a parameter we can set to make the uploader send the request via HTTPS (we've not been able to find one).
var uploader = new qq.FileUploader({
// pass the dom node (ex. $(selector)[0] for jQuery users)
element: [% IF element %][% element %][% ELSE %]document.getElementById('file-uploader')[% END %],
// path to server-side upload script
action: '/lib/upload',
debug: true,
allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
sizeLimit: 10485760, // max size 10Mb
minSizeLimit: 100,
showMessage: function(message){ alert(message); },
onError: function(id, fileName, errorReason) {
if (errorReason.indexOf("code #6") != -1) {
warn('No space left');
alert('Error: You have no space for images left. Please contact support.');
}
},
onComplete: function(id, fileName, responseJSON){
if( ! responseJSON.filesdata || ! responseJSON.filesdata[0].url)
{
console.log(responseJSON);
//ngn_dump(responseJSON, true, 'responseJSON');
alert('Error: didn\'t get image url from server.');
}
else
{
console.log(responseJSON);
$('#[% id %]').attr('src',responseJSON.filesdata[0].url);
[% IF fieldname %]
$('#[% fieldname %]').val(responseJSON.filesdata[0].url);
[% END %]
}
},
params: {
label:'',
creationdate:'',
format:'json',
type:"[% rep_type %]",
session:"[% IF y; y.session.id; ELSE; c.sessionid; END; %]",
collection:"[% collectionId || story.id %]",
}
});