11-28-2017 01:04 AM
Hi,
11-28-2017 03:52 AM
Please add code for the same.
11-28-2017 05:51 AM
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!');
}
});
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.