我有以下发布请求,试图通过该发布请求在PDF
服务器上上传Alfresco Community Version On-Premise
文件:
var urlPost = 'http://127.0.0.1:8080/alfresco/service/api/upload?alf_ticket=' + ticket;
let header = new HttpHeaders();
header = header.append("Authorization", "Basic " + btoa("user:passwoed"));
var formData = {
filedata: file,
filename: fileName,
siteid: 'uploadsite',
containerid: 'documentLibrary',
uploadDirectory: '/',
description: 'Test description',
contenttype: 'cm:content',
thumbnails: 'doclib',
overwrite: 'false',
};
this.http.post(urlPost, formData, { headers: header }).subscribe(response => {
console.log(response);
}, err => {
console.log("User authentication failed!");
});
但是我遇到以下错误:
Error 403: Response for preflight does not have HTTP ok status.
当我用postman
命中请求时它起作用。经过一些研究,我发现我需要更改后端以不要求对OPTIONS方法进行身份验证,但是我不确定该怎么做那也是。
我是新来的,任何帮助将不胜感激。谢谢!