Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Deleted User 5 posts 95 karma points
    Dec 04, 2015 @ 09:47
    Deleted User
    0

    Attaching file in a contact form

    We are setting up a contact form in Contour where we have added a File upload field for attaching a file, but when we test the contact form, the attached file isn't included in the entry data received.

    Screen dump of the field in ContourAny ideas what we are doing wrong?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 04, 2015 @ 09:52
    Dennis Aaen
    0

    Hi Knud,

    What version of Umbraco and Contour are you using?

    /Dennis

  • Deleted User 5 posts 95 karma points
    Dec 04, 2015 @ 09:58
    Deleted User
    0

    We're using Umbraco v6.2.5 and Contour v3.0.28.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 04, 2015 @ 11:59
    Dennis Aaen
    0

    Hi Knud,

    I have now tested Umbraco 6.2.5 and Contour 3.0.28, I assume that when you upload a file, then you will see the path to the upload file. If you added that path to your domain name then you can download the file.

    That is not so user-friendly so what you can do to make it a bit more user-friendly is.

    In your work-flow for your from, choose the option to use Send xslt transformed email work flow. When you use this you have the option to customize how the email should look like.

    You can find the XSLT for the email in this folder \Umbraco\Plugins\umbracoContour\xslt\sendXsltEmailSample, if you open this file, and overrite it with this code below, https://gist.githubusercontent.com/PaulSorensen/7983503/raw/e2a975e120703bf0cf3e7acd5df21a2b9bfda94c/contourXSLTwithURL.xslt

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:user="urn:my-scripts"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="xsl msxsl user umbraco.library">
    
      <xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
      doctype-system="DTD/xhtml1-strict.dtd"
      cdata-section-elements="script style"
      indent="yes"
      encoding="utf-8"/>
    
      <xsl:param name="records" />
    
      <xsl:template match="/">
        <table style="border-collapse:collapse;border:1px solid black;">
              <xsl:for-each select="$records//fields/child::*">
                <xsl:sort select="@sortorder" data-type="number"/>
               <tr style="border:1px solid black;">
                      <td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;">
                          <strong>
                           <xsl:value-of select="./caption"/>
                          </strong>
                    </td>
                    <td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;">
                          <xsl:choose>
                             <xsl:when test="contains(.//value, '/umbraco/plugins/umbracoContour/files/')">
                                 <a href="http://{umbraco.library:RequestServerVariables('SERVER_NAME')}{.//value}">
                                    <xsl:value-of select="substring-after(substring-after(.//value, '/files/'), '/')"/>                      
                               </a>
                             </xsl:when>
                              <xsl:otherwise>
                                  <xsl:for-each select="./values/value">
                                      <xsl:if test="position() &gt; 1">
                                       <br />
                                      </xsl:if>
                                    <xsl:value-of select="umbraco.library:ReplaceLineBreaks(.)"/>
                               </xsl:for-each>
                              </xsl:otherwise>
                         </xsl:choose>
                      </td>
                </tr>
            </xsl:for-each>
          </table>
      </xsl:template>
    </xsl:stylesheet>
    

    Then you will get a link to the file that you have uploaded. What you just need to do is add the XSLT file to the work-flow.

    enter image description here

    Hope this helps,

    /Dennis

  • Deleted User 5 posts 95 karma points
    Dec 04, 2015 @ 14:42
    Deleted User
    0

    Hi Dennis,

    Thanks for your reply, but I don't get the path to the uploaded file - in fact it seems the file isn't uploaded at all, as it is not present in either the entry data in Contour nor the e-mail I get due to the workflow I set up.

    Screen dump of form entry in Contour Screen dump of e-mail with form entry

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 04, 2015 @ 17:02
    Dennis Aaen
    100

    Hi Knud,

    Maybe you have some permissions issue, so it donĀ“t have acces to the folder where it try to save the attached file.

    The uploaded files in Contour are saved in \Umbraco\Plugins\umbracoContour\files

    Could you please check that you have the permissions on files and folders in your Umbraco installation as described here. https://our.umbraco.org/documentation/Getting-Started/Setup/Server-Setup/permissions and https://our.umbraco.org/documentation/Getting-Started/Setup/Requirements/

    Hope this helps,

    /Dennis

  • Deleted User 5 posts 95 karma points
    Dec 08, 2015 @ 13:29
    Deleted User
    0

    Hi Dennis,

    The strange thing is that the Attach file function works fine in the preview of the contact form in Contour (i.e. attached files are present in the entry data in Contour and in the workflow e-mails), but it doesn't work in the published contact form.

    There is access to the folder \umbraco\plugins\umbracoContour\files

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 08, 2015 @ 13:35
    Dennis Aaen
    0

    Hi Knud,

    Do you have the possibility to send us a copy of your database and website so we can try debug on this.

    You can send me an email at dennis at umbraco .com

    /Dennis

  • Amigo 243 posts 568 karma points
    Apr 14, 2016 @ 19:46
    Amigo
    0

    If the site is not using MVC, this problem can be solved by changing the render macro "Insert form from Umbraco Contour" to use the usercontrol "~/usercontrols/umbracoContour/RenderForm.ascx" instead of the "MvcRenderContourForm.cshtml" file.... ;-)

Please Sign in or register to post replies

Write your reply to:

Draft