Hi,
Please add code for the same.
the code is below which is working fine on all browsers except the Firefox
function check_form(formname) {
window.onbeforeunload = null;
var folderName = document.getElementById('name').value;
var getUrl = window.location;
var baseUrl = getUrl .protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1];
var data;
$.ajax({
type: 'POST',
url: baseUrl +'/index.php?entryPoint=customEntryPointAlfrescoConfig',
data:
{
alfresco_foldername: folderName,
},
cache: false,
success: function(html){
data = html;
callAlfresco(data);
},
error: function(xhr,status,error) {
alert('Error!');
}
});
return true;
}
function callAlfresco(data){
var protocol = location.protocol;
var res = data.split("/");
var alfrescoLogin = res[0];
var alfrescoPassword = res[1];
var alfrescoNodeId = res[5];
var alfrescoTicketId = res[6];
var d = new Date();
var alfrescoBaseUrl = res[2]+":"+res[3];
var uploadName = 'File_Time' + d.getTime();
var uploadFiles = document.getElementById('filename_file').files;
var form = new FormData();
form.append('name', uploadName);
form.append('nodeType', 'cm:content');
form.append('filedata', uploadFiles[0]);
$.ajax({
username: alfrescoLogin,
password: alfrescoPassword,
url: protocol+'//'+alfrescoBaseUrl + '/alfresco/api/-default-/public/alfresco/versions/1/nodes/'+alfrescoNodeId+'/children?alf_ticket='+alfrescoTicketId,
method: 'POST',
mimeType: 'multipart/form-data',
data: form,
async: true,
crossDomain: true,
processData: false,
contentType: false,
success: function(result,status,xhr) {
alert('Sucess!');
// $('#go-button').click();
},
error: function(xhr,status,error) {
alert('Error!');
}
});
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.