I'm trying to get my file upload extension working fro a project we are doing. I have tried to make an extension in C# to which accepts HttpPostedFile for the uploaded file. But the error message states the following;
[quote]
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension function parameters or return values which have Clr type 'HttpPostedFile' are not supported.
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList1[] args)<br />
at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Inetpub\xxxxx\xslt\Werkzoekende.xslt:line 45
[/quote]
The end result should be that the uploaded file is attached to an e-mail message and send to an email address. before this is done we need to check the mime type to prevent "not welcome" file types. I'm using Umbraco v4.0RC3.
Use doc2form that can handle uploads and sends out emails.
I have done it in the past where i wanted end users to be able to upload as part of job application a cv/resume. You can get it from codeplex. As a general rule of thumb use xslt for data presentation and .net controls for data capture.
I have tried doc2form 2 beta 3. Every thing is weel when creating the form, but after submitting the form I get the error listed bellow, any suggestions whan i'm doing wrong?
I have search the forum, but no sollutions yet.
[quote]Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
cln.umb.Doc2Form.btnSubmit_Click(Object sender, EventArgs e) +7459
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
[/quote]
Handling File uploads from public through a form
Hi,
I'm trying to get my file upload extension working fro a project we are doing. I have tried to make an extension in C# to which accepts HttpPostedFile for the uploaded file. But the error message states the following;
[quote]
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension function parameters or return values which have Clr type 'HttpPostedFile' are not supported.
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList
1[] args)<br /> at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList
1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Inetpub\xxxxx\xslt\Werkzoekende.xslt:line 45[/quote]
The end result should be that the uploaded file is attached to an e-mail message and send to an email address. before this is done we need to check the mime type to prevent "not welcome" file types. I'm using Umbraco v4.0RC3.
Can anybody help me with this?
Thanks.
xslt form:
[quote]
]>
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:Mirabeau="urn:Mirabeau"
exclude-result-prefixes="msxml Mirabeau umbraco.library">
[/quote]
Wouldn't it be easier to do this with a .net usercontrol ?
houdtbaar,
Use doc2form that can handle uploads and sends out emails.
I have done it in the past where i wanted end users to be able to upload as part of job application a cv/resume. You can get it from codeplex. As a general rule of thumb use xslt for data presentation and .net controls for data capture.
Regards
Ismail
Thanks, I will try doc2form.
Regards,
Erik
I have tried doc2form 2 beta 3. Every thing is weel when creating the form, but after submitting the form I get the error listed bellow, any suggestions whan i'm doing wrong?
I have search the forum, but no sollutions yet.
[quote]Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
cln.umb.Doc2Form.btnSubmit_Click(Object sender, EventArgs e) +7459
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
[/quote]
What about the form wrapping. Did you remember that?
) like described in this post:Try placing the control inside an ASP.Net form (
http://forum.umbraco.org/yafpostst7471doc2form-not-working-on-v4.aspx
Maybe that is the problem?
/Finn
No I did not forget the wrapping, see the code from my template bellow:
[quote]
FORM>
MACRO PublishOnSubmit="0" DocumentType="1250" TabName="formulier" PageTabs="0" HideTabNames="1" ShowDescriptions="0" RequiredText="Dit veld is verplicht" SubmitButtonText="verzenden" PreviousButtonText="" NextButtonText="" TextOnSubmit="Bedankt voor het verzenden" RedirectToNode="" StorePropertiesInCookies="" SendEmailResponse="0" ResponseSubject="" ResponseMessage="" ResponseEmailFieldAlias=", " ResponseCopyTo="" EmailForm="0" FormSubject="Sollicitatie via de website" FormMessage="geen idee
" FormToEmailAddress="xxxx" FormFromEmailAddress="xxxxx" UseAjax="0" DefaultValueNode="" macroAlias="Doc2FormEmail">
[/quote]
you are using v4 change your form tag to standard .net one ie
Regards
Ismail
If you change your
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.