Recently we copied our _admin folder and KDBs from other environment to our stag

Recently we copied our _admin folder and KDBs from other environment to our staging/UAT. Since then, while using the smart service "Appian document from Base64 String" we are getting below Alert

The document could not be created. Error: Attempt to write over a file that already exists [fileName = E:\\appian\\_admin\\accdocs2\\8\\10264112.pdf].

Do we need to re import our accdocs folders to fix this issue?
Also can anyone let us know the why this error is occurring?

OriginalPostID-168903

OriginalPostID-168903

  Discussion posts and replies are publicly visible

Parents
  • Eduardo, thanks for your response. That's actually exactly what I did. I did it because without doing that my internal filename was null, which in turn caused my code to not work. How can I tell Appian to go ahead and set its internal filename and id and then return them to me? I figured out what I could from the public Java API, but for lack of more thorough knowledge on Appian's internal workings this is my code looks:

              String mergeResultDocName = "Merge_Result_Doc";
                        String mergeResultDocExtension = "pdf";
                        Document mergeResultDoc = new Document(folder, mergeResultDocName, mergeResultDocExtension);
                        mergeResultDoc.setSize(1);
                        mergeResultDoc.setFileSystemId(ContentConstants.ALLOCATE_FSID);
                        mergeResultDoc.setInternalFilename("C:\\\\appian\\\\_admin\\\\accdocs3\\\\2050\\\\" + mergeResultDocName + ".pdf");
                        mergeResultDoc.setState(ContentConstants.STATE_ACTIVE_PUBLISHED);
                        Long docId = cs.create(mergeResultDoc, ContentConstants.UNIQUE_FOR_TYPE);
                        mergeResultDoc.setId(docId);
                        
                        try {
                                  File destinationFile = new File(mergeResultDoc.getInternalFilename());
                                  FileOutputStream fos = new FileOutputStream(destinationFile, true);
                                  Rectangle size = RectangleFinder.getRectangleSize(inputs);
                                            
                                  PdfVeryDenseMergeTool tool = new PdfVeryDenseMergeTool(size, paddingSize, paddingSize, contentGapSize);
                                  tool.merge(fos, inputs);
                        
                        } catch (Exception e) {
                                  System.out.println("*******There has been an error creating the fileoutput stream and running the merge tool.******");
                                  System.out.println(e);
                        }
Reply
  • Eduardo, thanks for your response. That's actually exactly what I did. I did it because without doing that my internal filename was null, which in turn caused my code to not work. How can I tell Appian to go ahead and set its internal filename and id and then return them to me? I figured out what I could from the public Java API, but for lack of more thorough knowledge on Appian's internal workings this is my code looks:

              String mergeResultDocName = "Merge_Result_Doc";
                        String mergeResultDocExtension = "pdf";
                        Document mergeResultDoc = new Document(folder, mergeResultDocName, mergeResultDocExtension);
                        mergeResultDoc.setSize(1);
                        mergeResultDoc.setFileSystemId(ContentConstants.ALLOCATE_FSID);
                        mergeResultDoc.setInternalFilename("C:\\\\appian\\\\_admin\\\\accdocs3\\\\2050\\\\" + mergeResultDocName + ".pdf");
                        mergeResultDoc.setState(ContentConstants.STATE_ACTIVE_PUBLISHED);
                        Long docId = cs.create(mergeResultDoc, ContentConstants.UNIQUE_FOR_TYPE);
                        mergeResultDoc.setId(docId);
                        
                        try {
                                  File destinationFile = new File(mergeResultDoc.getInternalFilename());
                                  FileOutputStream fos = new FileOutputStream(destinationFile, true);
                                  Rectangle size = RectangleFinder.getRectangleSize(inputs);
                                            
                                  PdfVeryDenseMergeTool tool = new PdfVeryDenseMergeTool(size, paddingSize, paddingSize, contentGapSize);
                                  tool.merge(fos, inputs);
                        
                        } catch (Exception e) {
                                  System.out.println("*******There has been an error creating the fileoutput stream and running the merge tool.******");
                                  System.out.println(e);
                        }
Children
No Data