This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Server method to modify a file on the server (Server check In)

JensRollenmueller - Monday, November 8, 2010 9:49 AM:

Hello,

i am trying to so following steps in batch:

  1. check out a file on the server
  2. modify this file
  3. check in file again

Therefore i tried following VB code - unfortunately with no success:

Dim myInnovator = Me.NewInnovator()
Dim fileItem      As Item
Dim newFileItem   As Item

fileItem = myInnovator.getItemByID("File", "F4D9962EC35F414B97C16C6D0A972C97")
fileItem.checkout("C: mp")

=> File successfully checked out on the server
=> Then I modify my file per batch and try to check it in to the SAME file Item

...

fileItem.attachPhysicalFile("C: mpTEXT.txt")
fileItem = fileItem.apply()
If (fileItem.isError()) Then
   Return fileItem
End If

=> No error but unfortunately the file is NOT REVISED and NOT overwritten !!!
=> I still have the non modifified File in my Database

Any ideas - I tried several things without success !

Regards, Jens