Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
5 subscribers
Views
3817 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Recently we copied our _admin folder and KDBs from other environment to our stag
Mahesh Sanga
over 8 years ago
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
0
malcolmp
over 8 years ago
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);
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
malcolmp
over 8 years ago
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);
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data