Hi - Using Infopath 2007,
I have set up a form with 50ish fields and potentially 20 or so file attachments. This form is published in a sharepoint document library, but I want to be able to save some of the information to a SQL Server database.
I have set up the SQL Server db - the fields to store the file attachments are of type varbinary(8000) - (I hope that is correct ?).
I have set up a webservice to process the 'ordinary' fields which is working correctly.
I have now turned to the file attachments. I have read several articles on 'decoding the file attachments' to write out files - but am unsure about WHAT to write out to the SQL database. I believe there is a header which is of length 24 bytes + length of the filename. Following this head is the file contents. These are base64 encoded. - so do I get rid of the header completely ? - what do I do about the filename ?
I have created a query form based on my SQL database and selected one of the fields containing the 'file attachment stuff', when I run the query the binary content of the field is displayed in a text box. I have been into the design and tried to convert the field from a text box - but file attachment is not an option.
So my questions are......
1. Am I trying to store the file attachments in the correct data type ?
2. Which bit of the file attachment xml do I need to write to the SQL Database ?
3. How do I get the file attachment back out of the SQL database to display in an infopath query form?
Thank you
Catharine