Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

my scenario is that I have a scanner that uses oculus software, the software scans into a folder, now want this folder to be a source of documents for sharepoint. Is it possible?

am using sharpoint 2010 enterprise

share|improve this question

2 Answers 2

up vote 1 down vote accepted

All document SharePoint are stored in database besides you configure BLOB cache on your server. As mantioned @mike to resolve this you need to push scenned documents to SharePoint useing API model of SharePoint.

You can do this using next code in your windows service:

        using (SPSite site = new SPSite("http://testsite.dev"))
        {
            using (SPWeb web = site.OpenWeb())
            {
                using (FileStream fs = File.OpenRead(@"C:\Debug.txt"))
                {
                    byte[] buffer = new byte[fs.Length];
                    fs.Read(buffer, 0, (int) fs.Length);

                    SPList list = web.GetList("Lists/Test AAD");
                    SPFile f = list.RootFolder.Files.Add("/Shared Documents/"+Path.GetFileName(fs.Name), buffer);
                }
            }
        }

Hope it helps,

Andrew

share|improve this answer
    
That's a nice answer, but you don't have to use SharePoint API, we just used a simple SMTPClient and pushed the file through as an attachment programmatically. –  Mike Feb 13 '13 at 17:48

We have a similar setup. For every file that gets uploaded to a folder, we developed a windows service that will target that folder and everything that gets posted to it will email to a SharePoint document library, then delete the file in the folder. It works pretty well for us assuming you have the service automatically running. The web service is just using StreamReader and SmtpClient classes

share|improve this answer
    
thanks for the answer will try this –  Eddy Feb 18 '13 at 5:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.