Dim SharePointHost As String = "http://serveur2003vm:60666/"
Dim ImagingServiceName As String = "_vti_bin/Imaging.asmx"
'the user credentials to use
ImagingService.Credentials = New NetworkCredential(UserName, Password, Domain)
ImagingService.Url = SharePointHost + ImagingServiceName
' open the file and create a buffer which can hold the file
Dim Stream As New FileStream(strImageFilePath, FileMode.Open)
Dim Buffer(Stream.Length) As Byte
'read the file into the buffer and close the stream
Stream.Read(Buffer, 0, Buffer.Length)
Stream.Close()
'upload the file
'images est le nom de ma Pictury library
Dim ListName As String = "images"
Dim Folder As String = ""
Dim DestinationFileName As String = "test.TIF"
Dim OverwriteIfExists As Boolean = True
ImagingService.Upload(ListName, Folder, Buffer, DestinationFileName, OverwriteIfExists)
Partager