humzariaz
03/05/2020, 11:33 AMvar file_data = $('#attachFile' + i).prop('files')[0];
var form_data = new FormData();
form_data.append('file', file_data);
and then post form_data
Restlet CODE
var file = valuesArray[i].file;
here i tried to stringify file object the result i got "{}"
this
file.setFolder(199); //*Error is here Cannot find set.folder function*
var id = file.save();
but after giving my all efforts file is not saving in file cabinet !
Does anyone have idea on this?NElliott
03/05/2020, 12:02 PMhumzariaz
03/06/2020, 5:49 AMTypeError: Cannot find function create in object [object Object].
now i am getting this error @NElliottNElliott
03/06/2020, 8:51 AMNElliott
03/06/2020, 8:51 AMhumzariaz
03/06/2020, 1:45 PMvar imagebase64;
var file_data = $('#attachFile' + i).prop('files')[0];
var reader = new FileReader();
reader.onloadend = function() {
imagebase64 = reader.result;
console.log(imagebase64);
}
reader.readAsDataURL(file_data);
humzariaz
03/06/2020, 1:46 PMhumzariaz
03/06/2020, 1:51 PMvar file = valuesArray[i].file;
log.debug({
title: 'Debug Entry',
details: 'Value of img is: ' + JSON.stringify(file)
});
var fileObj = file.create({
name: 'test.png',
fileType: file.Type.PNGIMAGE,
contents: file,
isOnline: true
});
fileObj.setFolder(199);
var id = fileObj.save();
humzariaz
03/06/2020, 1:53 PM