Extract File attachments to WSS - InfoPath Dev
in

InfoPath Dev

Extract File attachments to WSS

Last post 02-20-2006 12:23 PM by AndersR. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-18-2006 02:42 PM

    Extract File attachments to WSS

    My goal is to not store attachments in the InfoPath file. Couple ideas on how to acheive that are to:

    Option 1 - Allow users to add attachments to an InfoPath form and right before a submission, take all of the files and store them in WSS document list.
    Option 2 - Somehow show a user a list of documents from WSS (filtered at times). Create some buttons on the form to allow the users to upload or remove a file to WSS through InfoPath.

    Any ideas on about doing this?

    I found this.
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1213

    As far my thinking goes I would have to create a couple web service to:
    - Add a document to wss
    - Remove a document from wss
    - Get a list of document names, links to make available in InfoPath. (plus I would want to provide criteria too)

    Thoughts
    Jason
    http://www.k2distillery.com/
  • 02-19-2006 03:11 PM In reply to

    Re: Extract File attachments to WSS

    Hi vt,

    reading your post i thought of why you would wanna do this.

    could you maybe sketch the scenario to make us better understand what you're trying to achieve?

    Both option 1 and 2 is viable solutions wich i have done before (except deleting the document, but i dont expect any problems there).

    Depending on if we are talking images or files in general, you can use imaging.asmx web service or create your own custom SPS web service (described in SPPT home on MSDN).

    If we are talking attachments youll need to remove the IP header (as i describe in the thread you mentioned).

    hth

    //AndersR
  • 02-19-2006 08:53 PM In reply to

    Re: Extract File attachments to WSS

    I would really appreciate the help, I am in jam and need to get this figured out.

    The issue is performance, I do not want to have large attachments in the XML. Second, I am using this software called K2, and it stores the XML from infopath in its DB. For several reasons, this XML can be stored several times when completing a workflow and if there are attachments in the XML, it can un-necessarily increase the size of the DB.

    So a scenario is a user opens up an infopath form. They have a control (maybe the file attachment control) >> select a file >> and then when the user submits save the file to WSS.

    Also I know that I could add a custom column in WSS to the document library. Would it be possible to also update that column with a piece of description infomration (for instance a requisition number) when inserting the image into the WSS list?

    Do not worry about deleting for now. I really need to get the insert working.

    Did you have any code for this custom webservice that could consume a file from InfoPath and subsequently push it to wss?
    Jason
    http://www.k2distillery.com/
  • 02-19-2006 09:12 PM In reply to

    Re: Extract File attachments to WSS

    AndersR,

    I just tried to do a direct submit on a dummy form I put together directly to the Upload web method on imaging.aspx and I get an error that it cannot find the site. What would be the proper value for strListName and strFolder if the web address to the list I want to try to submit to ishttp://sps.k2mega.local/sites/sales/Shared%20Documents/Forms/AllItems.aspx

    Any ideas? You mentioned that you create your own SPS web service. What were the circumstances around that?

    thanks...
    Jason
    http://www.k2distillery.com/
  • 02-20-2006 12:29 AM In reply to

    Re: Extract File attachments to WSS

    Hi jason,

    creating a custom SPS WS would definately be the way for you to go, since SPS doesnt support uploading files to document libraries using web services (the method is in the SDK but isnt implemented).

    This link will get you a long way
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/odc_writingcustomwebservicesforsppt.asp

    It thoroughly describes what needs to be done to upload documents using a custom web service.

    All you then need to do is edit the document properties with your meta data (requisition number) and update the SPFile list item.

    The code in IP is straight forward, just include the custom web service in your web references and call it using DefaultCredentials when iterating your repeating table that contains attachment and meta data.

    Only hickup you should expect is that you should remove terminating zeros in the filename you exctract from the IP attachment -else your web service will fail.

    The code to remove header in IP is in the thread you reffered to yourself.

    hth

    //AndersR
  • 02-20-2006 07:19 AM In reply to

    Re: Extract File attachments to WSS

    Thanks! Really appreciate the help!
    Jason
    http://www.k2distillery.com/
  • 02-20-2006 12:23 PM In reply to

    Re: Extract File attachments to WSS

    np vt ;-)

    //AndersR
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.