Upload Scanned Document Direct to folder using webtwin

cancel
Showing results for 
Search instead for 
Did you mean: 
aelgendy
Member II

Upload Scanned Document Direct to folder using webtwin

Pls I need sample code how to upload scanned document from dynmsoft webtwin scanner to specific folder on repository.

I tried the below code but not working

var uploadfilename="TestScannedDoc;

var strHTTPServer ="127.0.0.1";

var CurrentPathName = unescape(location.pathname);

DWObject.HTTPPort = "8080";

var strActionPage ="alfresco/api/-default-/public/cmis/versions/1.1/atom";

DWObject.HTTPUploadAllThroughPostAsPDF(strHTTPServer, strActionPage, uploadfilename + ".pdf", OnSuccess, OnFailure);

2 Replies
sanjaybandhniya
Intermediate

Re: Upload Scanned Document Direct to folder using webtwin

This way you can upload document.

var $siteURL = Alfresco.util.siteURL;
var url = Alfresco.constants.PROXY_URI+'api/upload';
var today = formatDate(new Date())+"-"+Math.random();



DWObject.ClearAllHTTPFormField();
DWObject.SetHTTPFormField("siteId", Alfresco.constants.SITE);
DWObject.SetHTTPFormField("containerId", Alfresco.constants.PAGEID);
DWObject.SetHTTPFormField("overwrite", 'false');
console.log("currentPath:"+currentPath);
DWObject.SetHTTPFormField("uploaddirectory", this.currentPath);


DWObject.ConvertToBlob(indicesAre, EnumDWT_ImageType.IT_PDF,
function (result) {
DWObject.SetHTTPFormField('filedata', result, today+".pdf");
DWObject.HTTPUpload(url, OnHttpUploadSuccess, OnHttpUploadFailure);
}, asyncFailureFunc);

aelgendy
Member II

Re: Upload Scanned Document Direct to folder using webtwin

Thanks For your replay but can you tell me please how to use alfresco java script API so that i can use your code i am searching from long time but no success.