| | |
| | | |
| | | public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType) { |
| | | base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8'); |
| | | |
| | | // 20231103 Lightning文件修改 Start |
| | | // Attachment oAttachment = new Attachment(); |
| | | // oAttachment.parentId = parentId; |
| | | |
| | |
| | | insert link; |
| | | |
| | | return link.ContentDocumentId; |
| | | // 20231103 Lightning文件修改 End |
| | | } |
| | | |
| | | private static void appendToFile(Id fileId, String base64Data) { |
| | | base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8'); |
| | | |
| | | // 20231103 Lightning文件修改 Start |
| | | // Attachment a = [ |
| | | // SELECT Id, Body |
| | | // FROM Attachment |
| | |
| | | verison.VersionData = EncodingUtil.base64Decode(existingBody + base64Data); |
| | | |
| | | update verison; |
| | | // 20231103 Lightning文件修改 End |
| | | } |
| | | |
| | | //文件删除功能 精琢技术 thh 2021-09-26 start |
| | | @AuraEnabled |
| | | public static void deleteChunk(Id AttachmentId) { |
| | | // 20231103 Lightning文件修改 Start |
| | | // Attachment attachment = new Attachment(); |
| | | // attachment.id = AttachmentId; |
| | | |
| | |
| | | ContentDocument con = new ContentDocument(); |
| | | con.Id = AttachmentId; |
| | | delete con; |
| | | // 20231103 Lightning文件修改 End |
| | | } |
| | | //文件删除功能 精琢技术 thh 2021-09-26 end |
| | | |