Following Problem:
Using: Infopath 2007, VSTA, MOSS
i need to add a specific pdf file to my Sharepoint Document Library. I tried this command but i get the following error
Command:
My
.Computer.Network.UploadFile("c:\3.pdf", "http://server:33655/pdfs/3.pdf", "username", "password", True, 500)
Error:
"System.Net.WebException wurde nicht von Benutzercode behandelt.
Message="The remote server returned an error: (404) Not Found."
Source="Microsoft.VisualBasic"
StackTrace:
at Microsoft.VisualBasic.MyServices.Internal.WebClientCopy.UploadFile(String sourceFileName, Uri address)
at Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, Uri address, ICredentials networkCredentials, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
at Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, Uri address, String userName, String password, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
at Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, String address, String userName, String password, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
at Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, String address, String userName, String password, Boolean showUI, Int32 connectionTimeout)
at _23._12._09.FormCode.CTRL418_5_Clicked(Object sender, ClickedEventArgs e) in C:\...\FormCode.vb:line 390
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
"
This command looks very simple, but i dont get it.
Have also tried several other commands like my.computer.filesystem.copyfile(...) but it doesn't like URI as source or destination file. {"URI formats are not supported."}
Btw. exporting views to the Library is no problem (using " Me.CurrentView.Export("http://hansewww:33655/PDFs/" + fileName, ExportFormat.Pdf " )
Thanks for help.
edit:
http://msdn.microsoft.com/en-us/library/w3kksch7(VS.80).aspx