Agent 'DataSetup' error: Disk i/o is a restricted operation

I am writing a simple agent to extract attachment placed by users in a web form for processing.

Below is the test code. I am receiving the above error. Can anyone help me understand why. I signed the agent using an administrator ID will full rights.

Sub InitiateData()

Dim CurrentDB As NotesDatabase

Dim Document As NotesDocument

Dim object As NotesEmbeddedObject

Set Sess = New NotesSession

Set Document = Sess.DocumentContext		

Set object=Document.GetAttachment("term_tbl.dat")

TempPath="c:\Temp\"+ object.Name

object.ExtractFile(TempPath)

End Sub

Subject: Agent ‘DataSetup’ error: Disk i/o is a restricted operation

Make sure the signer of the agent has rights to run restricted agents. You can see it in the server document.Set agent’s property “runtime security level” to “Allow restricted operations”.

Subject: RE: Agent ‘DataSetup’ error: Disk i/o is a restricted operation

Thanks that worked. I missed out on the agent property.

BTW, do you have idea why in the same agent I get type mismatch error when I introduce the following code:

If doc.HasEmbedded Then

Forall o In doc.EmbeddedObjects

  Messagebox( o.Name )

End Forall

Else

Subject: RE: Agent ‘DataSetup’ error: Disk i/o is a restricted operation

Sub InitiateData() Set Sess = New NotesSession

Dim CurrentDB As NotesDatabase

Dim Doc As NotesDocument

Dim object As NotesEmbeddedObject



Set Doc = Sess.DocumentContext



If doc.HasEmbedded Then

	Forall o In doc.EmbeddedObjects

		Set object=doc.GetAttachment("term_tbl.dat")

		TempPath="c:\Temp\"+ object.Name

		object.ExtractFile(TempPath)	

	End Forall

end if

End Sub

Subject: RE: Agent ‘DataSetup’ error: Disk i/o is a restricted operation

I think it’s because variable “o” was already used in your script to refer to another data type. If it is not the case, run the code in debugger and see what kind of value “o” gets.

From Designer Help:“EmbeddedObjects does not return the Ami Pro document because the object was created in Notes Release 3. It does not return castle.bmp because castle.bmp is a file attachment.”