Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Errors Uploading a doc via ADO using DataSource.SaveTo

  Asked By: Shana    Date: Dec 05    Category: Sharepoint    Views: 1444

I am trying to upload a document using the SaveTo method of DataSouce
from an asp. Here's my code:

Dim oDoc
Dim oStream 'As ADODB.Stream
Dim nIndex
Dim sPropName
dim adTypeBinary
dim adCreateOverwrite
adTypeBinary = 1
adCreateOverwrite = &h4000000

set oDoc = Server.CreateObject("CDO.KnowledgeDocument")
oDoc.Author = sDocAuthor

Set oStream = oDoc.OpenStream
oStream.Type = adTypeBinary
oStream.SetEOS
oStream.LoadFromFile sFilestream
oStream.Flush

If sCC <> "" Then
oDoc.ContentClass = sCC
End If
oDoc.DataSource.SaveTo sHref, , , adCreateOverwrite

Set CreateDocument = oDoc


However, I keep getting the following error:

Error Type:
CDO.KnowledgeDocument.1 (0x80004005)
Unspecified error
/spsdemo/doit.asp, line 113

Line 113 is this line: oDoc.DataSource.SaveTo sHref, , ,
adCreateOverwrite

I believe I have ruled out any language or IIS environment problems,
but this unspecific error leaves me with nothing to go on. Has
anyone done this successfully from an asp?

Share: 

 

8 Answers Found

 
Answer #1    Answered By: Aayushman Kanvinde     Answered On: Dec 05

Check your temp file wherever that is located (mine is under documents
and settings profile). See if you have many temp files and try to delete
them. After that retry your code.

Let me know if it does or does not work.

 
Answer #2    Answered By: Edgardo Atkins     Answered On: Dec 05

I deleted my temp files and ran my code  again, but got the same
message. Any more ideas?

 
Answer #3    Answered By: Kamal Mayachari     Answered On: Dec 05

What are you passing in for sFilestream?

 
Answer #4    Answered By: Kelsie Terrell     Answered On: Dec 05

The following URL: http://ntsloan01/engineering/documents/CAD%
20Drawings/testing.dwg

 
Answer #5    Answered By: Puneet Shiwde     Answered On: Dec 05

Curious, what if you hard code  a file instead of a url and see if your
problem goes away. I ran your code using a file and ran without problem.

 
Answer #6    Answered By: Brandyn Slater     Answered On: Dec 05

I gave you the sHref and not the sFilestream. It is
D:\test.dwg

 
Answer #7    Answered By: Hubert Pollard     Answered On: Dec 05

Now you got me. I used your code  in a asp  page to load a file off the
local drive into an existing workspace without problem. I am set up as
coordinator and local admin which might make a difference if you are
not same on your machine. I do not use dwg files so I used a txt file
instead. Might try a txt file instead to see if that works.

 
Answer #8    Answered By: Gladys Trevino     Answered On: Dec 05

I think you are on the right track. 80040005 errors  are access related. So
the first place to look would be to see if the account the script runs under
has all the appropriate permissions to the directory via WebDAV (the web
share). I use the same basic code  with .txt files also and all problems I
have had tended to be permissions-related.

 
Didn't find what you were looking for? Find more on Errors Uploading a doc via ADO using DataSource.SaveTo Or get search suggestion and latest updates.




Tagged: