Hi Everyone,
I need help for Upload documents into alfresco using Angula JS without user credentials.
document upload with metadata and site-name
Can anyone help me out please.
By default it is not possible to upload documents without authentication details into Alfresco since all modifying APIs require authentication to properly determine user privileges and avoid unauthenticated spam. If you need to have unauthenticated upload (very dangerous) you'd first need to create some custom ReST API via web scripts for that where you might impose any sort of controls / protection yourself.
Hi Axel Faust ,
Thank you so much for the reply ,
actually i made one external application that application have AD credentials, After logged in that application i am showing alfresco documents. in that page i need to add one more button like upload documents into alfresco. in this i need help for upload document without user credentials.
I am following this code
@RequestMapping(value = "/upload",headers=("content-type=multipart/*"), method = RequestMethod.POST)
public ResponseEntity<String> upload(HttpServletRequest request,
@RequestParam String siteName,
@RequestParam String contentAuthor,
@RequestParam String userid,
@RequestParam String password,
@RequestParam("uploadDirectoryPath") String uploadDirectory,
@RequestParam("uploadDocumentPath") MultipartFile uploadDocumentPath) {
Upload upload=new Upload();
try {
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null) {
ipAddress = request.getRemoteAddr();
}
LOG.info("IPADDRESS:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"+ipAddress);
upload.setIpaddress(ipAddress);
upload.setRequestOn(DateUtils.getCurrentSystemTimestamp());
uploadManager.saveOrUpdate(upload);
LOG.info("-----------------------------------------------jsonObj.length():"+uploadDocumentPath.getOriginalFilename());
String imagePath = "";
//String categoryName = "";
upload.setSiteName(siteName);
upload.setContentAuthor(contentAuthor);
//upload.setContentTitle(URLEncoder.encode(contentTitle, "UTF-8"));;
upload.setUserid(userid);
upload.setPassword(password);
upload.setUploadDirectoryPath(uploadDirectory);
upload.setUploadDirectoryPath(uploadDocumentPath.getOriginalFilename());
/*final Part uploadDocumentPaths;
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.