1
votes

I am trying to save a document with an attachment. due to some computation activity i am using document1.save() on a button click, it works fine when run on localhost (document1 my data source name)

but if i run on a server it give me following error on the line document1.save() (NotesXSPDocumet)

Error while executing JavaScript action expression Script interpreter error, line=32, col=25: [TypeError] Exception occurred calling method NotesXspDocument.save() not allowed to access or modify file: C:\Windows\TEMP\notes7A62B2\xsppers\5\DAIGRDY62M not allowed to access or modify file: C:\Windows\TEMP\notes7A62B2\xsppers\5\DAIGRDY62M

if my knowledge is correct, while using xpages file-upload control, XPage first extract the attached file into a temp folder and then it use this file to save in document created.

i think that is what happening in this case and xsp is not able to access the attachment. it has something to do with server and permission to access file but i am not sure... does anyone come across something similar or any workaround or solution for such issue.

Thanks in advance for you help :)

Note: 1) if i use a simple submit button it works fine, issue only come when try to save NotesXspDocument.

2) if their is not attachment on the xPages it works fine. 3) Server version is 8.5.3

1

1 Answers

3
votes
  1. If you upload a file it is first stored in the xspupload folder.
  2. If the file upload is completed, the file is moved to the xsppers folder.
  3. In the xsppers folder theres is subfolder structure like this: /xsppers/[SESSIONID]/[DOCUMENT-FIELDNAME]/....
  4. If you save the document, the files in this folder are attached to the document.

It seems that the domino server is not allowed to access or create a new folder in the /xsppers/[SESSIONID]/ folder (Step 3).

Please check the security settings on your server for the /xsppers/ folder. Alternativly you could change the path settings with the xsp.persistence.dir.xsppers property to another path in the xsp.properties-file on the server