| infoRouter Document Management System - Web Services API Documentation |
| UploadDocument |
| Uploads a new document or creates a new version of an existing document in byte array format to the specified path. |
[Visual Basic] Public Shared Function UploadDocument(ByVal AuthenticationTicket As String, _ ByVal Path As String, _ ByVal FileContent As Byte(), _ ByVal VersionComment As String, _ ) as xmldocument
|
- AuthenticationTicket
- infoRouter Authentication Ticket
- Path
- An infoRouter document path
- FileContent
- The Content of the file. The Content must be in the format of the byte array.
- VersionComment
- The comments of the author for the uploaded document.
|
returns xml fragment. <response success="true" error=""> if success = "true", the document has been uploaded. if success = "false", the error attribute returns the error description.
|
The caller must have at least "Add" permissions on the folder.
If the specified path does not exist, the path will be created.
If a document with the same name already exists in the same path, a new version of the existing document will be created.
|
Public Sub UploadDocument_Sample() Const IRAuthenticationTicket As String = "sid-xxxxxxxxxxxxxxx" Const IRServerPath As String = "/public/sample/" Const LocalFilePath As String = "c:\temp\SummerPlan.doc" Const VersionComments As String = "" Dim IROBJ As InfoRouter.srv Try If System.IO.File.Exists(LocalFilePath) Then Dim FileName As String = System.IO.Path.GetFileName(LocalFilePath) Dim buffer() As Byte IROBJ = New InfoRouter.srv 'create byte array to upload Dim fs As System.io.FileStream = New System.io.FileStream( _ LocalFilePath, _ System.IO.FileMode.Open, _ System.IO.FileAccess.Read) 'create a BinaryReader Dim br As System.io.BinaryReader = New System.io.BinaryReader(fs) buffer = br.ReadBytes(fs.Length) br.Close() fs.Close() br = Nothing fs = Nothing 'call upload method Dim xml_response As System.Xml.XmlElement xml_response = IROBJ.UploadDocument(IRAuthenticationTicket, _ IRServerPath & FileName, _ buffer, _ VersionComments)
'check response xml if any error occured. If xml_response.GetAttribute("success") = "true" Then Console.WriteLine("The Document has been uploaded successfully") Else Console.WriteLine("The Document cannot be uploaded.") Console.WriteLine(xml_response.GetAttribute("error")) End If xml_response = Nothing Else Console.WriteLine("Local file not found.") End If Catch ex As Exception MsgBox(ex.Message) Finally IROBJ = Nothing End Try End Sub
|
Download Document | Lock | UnLock | Delete Document |
| Syntax based on infoRouter Document Management System Web Services API Version 7.0 |
| Copyright() 1998-2003 Active Innovations, Inc. |
| infoRouter Document Management System |
|