Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2008

Tip: Looking for answers? Try searching our database.

Problem with copy file using UNC path behind InfoPath form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kb at donovanhill - 19 Feb 2008 02:10 GMT
I have a button control which attempts to copy a file from disk to a
sharepoint library using the following VB.net code.

System.IO.File.Copy("F:\temp\test.pdf", "\\server003:40000\Shared
Documents\test.pdf")

The XP pro client PC gives the following error in the form's code
'The given path's format is not supported'

Any Ideas where I have gone wrong with the UNC path?

Signature

kb

Gavin McKay - 20 Feb 2008 02:18 GMT
Hello,

I'm not sure if the File.Copy command supports posting to a sharepoint site
in this way.  Posting to a sharepoint site is a HTTP PUT request from memory,
whereas the File.Copy is expecting a UNC network copy operation.  Does your
"\\server003:40000\Shared Documents\" allow you to copy via Windows Explorer?
That's my standard test case - if you can browse to
"\\server003:40000\Shared Documents\" and it doesn't prompt you for security
credentials *and* comes up in explorer, then in theory File.Copy should work.
The error you are getting suggests that File.Copy does not understand either
how to get to "\\server003:40000\Shared Documents\" or how to put your
document there.

If it doesn't, you may need to either use the Sharepoint object model, or
better yet the Sharepoint web services, to put your document on your
sharepoint library.  Should be plenty of examples on how to use the web
services interface and web services are definitely preferred if this process
isn't going to be run directly on your Sharepoint server.

HTH

Gavin.

> I have a button control which attempts to copy a file from disk to a
> sharepoint library using the following VB.net code.
[quoted text clipped - 6 lines]
>
> Any Ideas where I have gone wrong with the UNC path?
S.Y.M. Wong-A-Ton - 26 Feb 2008 09:56 GMT
If you are using the InfoPath client application, you can use the WebClient
class (see
http://msdn2.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx) to
upload a document to a SharePoint library. I wrote some upload code at the
end of this article:
http://enterprise-solutions.swits.net/infopath2007/programmatically-create-infop
ath-form-console-app.htm
.
I know you use VB.NET, but the translation should not be too difficult.
---
S.Y.M. Wong-A-Ton

> I have a button control which attempts to copy a file from disk to a
> sharepoint library using the following VB.net code.
[quoted text clipped - 6 lines]
>
> Any Ideas where I have gone wrong with the UNC path?
kb at donovanhill - 26 Feb 2008 21:55 GMT
Hi,

Thanks for your suggestions, I will try them out.

Much appreciated.
Signature

kb

> If you are using the InfoPath client application, you can use the WebClient
> class (see
[quoted text clipped - 16 lines]
> >
> > Any Ideas where I have gone wrong with the UNC path?
S.Y.M. Wong-A-Ton - 27 Feb 2008 08:15 GMT
No worries.
---
S.Y.M. Wong-A-Ton

> Hi,
>
[quoted text clipped - 22 lines]
> > >
> > > Any Ideas where I have gone wrong with the UNC path?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.