Saving Attachments on Infopath 2007 form on submit..

D

dannyboy

Hi All,

Being new to Infopath, i need some help !

I have created a form that a user can complete and also attach a file (word
doc).

What I would like to do is be able to save that attachment to a network
share when the user submits the form, which goes to a Sharepoint library.

Reason for not keeping on Sharepoint is due to space limitations..

Any ideas would be appreciated.

Thanks
dannyboy
 
S

Swathi (GGK Tech)

Hi,
Use the following script code to submit the attachment to the document
library.
attachmentNode = thisXDocument.DOM.selectSingleNode("xpath of the attachment
control").text;
var data = DecodeAttachment(attachmentNode.text); //decode the attachment
text and send that in to data variable.
try
{
// create a xmlhttp object
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
var url = "url of document library";

//put the document/attachment on SharePoint
oXmlHttp.Open("PUT", url, false);
oXmlHttp.Send(data);
}

Also go through the following link for more details.
http://www.infopathdev.com/forums/p/10029/35594.aspx#35594
 
D

dannyboy

Thanks for the reply Swathi..

Think I have not explained myself clear enough.

What I want to do is save the attachment to a Network Drive (like
\\server1\docs) when the user hits the submit button.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top