infopath web form automatically encode decode attachments?
-
viernes, 10 de agosto de 2012 16:07
infopath web form.
is there a way to automate the encoding / decoding of an attachment?
scenario:
user click attachment control, attaches file, files is moved to a doc library.
currently, the user has to click another button to trigger the encoding process.
Todas las respuestas
-
viernes, 10 de agosto de 2012 21:53
You could do the encoding when they submit the form? Or you could set the event to encode/decode to when the attachment control "Changes" and not on the Button press.- Editado AZandbergen viernes, 10 de agosto de 2012 21:54
- Marcado como respuesta Emir LiuMicrosoft Contingent Staff, Moderator jueves, 16 de agosto de 2012 3:16
- Desmarcado como respuesta eHaze jueves, 16 de agosto de 2012 3:24
- Marcado como respuesta eHaze viernes, 17 de agosto de 2012 14:55
-
jueves, 16 de agosto de 2012 18:54Any updates on this?
-
jueves, 16 de agosto de 2012 23:48
You will have to use a VSTA InfoPath form with code-behind where in you can decode the attachment and upload it to a library on Changed event of the control.
-
viernes, 17 de agosto de 2012 0:00
-
viernes, 17 de agosto de 2012 1:30
I have implemented downloading InfoPath attachments as zip files and validating user input in browser enabled InfoPath form using OnChanged event.
http://www.bizsupportonline.net/blog/2010/01/upload-document-sharepoint-infopath-form/
-
viernes, 17 de agosto de 2012 14:58
public void attachCtrl_Changed(object sender, XmlEventArgs e) { //Create an XmlNamespaceManager XmlNamespaceManager ns = this.NamespaceManager; //Create an XPathNavigator object for the Main data source XPathNavigator xnMain = this.MainDataSource.CreateNavigator(); //Create an XPathNavigator object for the attachment node XPathNavigator xnAttNode = xnMain.SelectSingleNode("//my:attachCtrl", ns); //Obtain the text of the node. string theAttachment = xnAttNode.Value; if (theAttachment.Length > 0) { InfoPathAttachmentDecoder myDecoder = new InfoPathAttachmentDecoder(theAttachment); myDecoder.SaveAttachment(@"C:\Users\me\Desktop\test"); } }The Changed event did the trick. Thank you!
For reference:
http://support.microsoft.com/kb/2517906

