Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharepoint system.io.packaging

Status
Not open for further replies.

kennedyeoin

Programmer
Jul 16, 2006
15
GB
I am tring to use packaging to copy a word document located on a sharepoint server.

The code I am using is

String packagePath="
Package docPackage = Package.Open(packagePath, FileMode.Create, FileAccess.ReadWrite);

I am recieving the error URI formats are not supported.

Does anybody know how to overcome this problem.

I really would appreciate any help,

Thanks
 
Can you try the Web folder path?

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Hi Phil.

Can you please explain what you mean by the web folder path?

What would this path look like?

thanks
 
If your target is on the LAN, you can refer to the document library through a Web folder address. It behaves just like the file system.

Example: \\mySPSserver\sites\mysite\shared%20documents

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Hi Phil.

I tried this and get the error The given path's format is not supported.
 
Ecch. Try escaping all the backslashes.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Hi, I tried escaping the backslashes but still no use.

Maybe I am going about this the wrong way, what I am trying to achieve is creating a new document in a document library with the template of that library.

I have tried numerous things, I was quite close with simply using

SPFile templ = mySite.getFile("forms/documents/template.doc")

templ.CopyTo("server/folder/newdocumentname")

This copy to method works perfect if the file being copied is in a regular folder however when you try to copy a file from within the forms folder an error is thrown saying that files from the forms folder cannot be copied and moved. It recommends copying the file off site first and then uploading it.

Have you any idea how I would go about thisrammatically prog, would I need to set up some temporary folder within my code to copy the file to and then upload from?

As always any help would be greatly appreciated.

Thanks


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top