Copied to clipboard

Flag this post as spam?

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


  • Brad 94 posts 151 karma points
    Mar 28, 2013 @ 06:30
    Brad
    0

    File upload - Where are the files?

    I'm using Umbraco 6.0.0.

    I have created a simple form which has file uploader  on it. When I fill in the form and submit it, the details I put in the form are displayed in the Umbraco dashboard in the View Entries for the form, but the file I uploaded is not listed there.

    This of course is utterly useless.

    1. How can I get a link to this file listed in the View Entries display for the form? (I can't believe I should have to ask this).

    2. Where is the file uploaded by the form?

     

     

  • Comment author was deleted

    Mar 29, 2013 @ 11:18

    Hmm it should just be listed in the entries viewer, with a clickable link...

    Will check it out

  • Comment author was deleted

    Mar 29, 2013 @ 11:20

    Yeah just tested an the file upload field is part of the entries viewer...

    Mind sharing a screenshot of the form and entries viewer?

  • Brad Ford 34 posts 75 karma points
    Apr 02, 2013 @ 00:55
    Brad Ford
    0

    Sure.. 

    Upon Submit I see the Thank You page.

    Now in Entries for this form I see this.

     

    No sign of the files I attached. 

    Furthermore, assming the files are uploaded, where would they appear in the folder structure of the site? I just want to check if the upload is happening at all. 

     

  • Brad Ford 34 posts 75 karma points
    Apr 02, 2013 @ 03:26
    Brad Ford
    0

    I just deleted and recreated the form, Now for some reason I get the file name listed, but it is not a clickable link. 

  • Comment author was deleted

    Apr 03, 2013 @ 11:11

    Hi Brad,

    What type of field are you using, doesn't look like the default upload one

    Cheers,
    Tim 

  • Brad Ford 34 posts 75 karma points
    Apr 03, 2013 @ 23:47
    Brad Ford
    0

    Tim

    The type I am using is a file uploader. 

    Looks like this in umbraco with the first one open for editing.  

     

     

    Am I missing something here?

  • Comment author was deleted

    Apr 04, 2013 @ 13:51

    Yeah looks like the default one but it's strange that you don't get the clickable link

    COuld you tell me the COntour version (you can see it at the bottom left of the Contour dashboard)

  • Brad 94 posts 151 karma points
    Apr 05, 2013 @ 00:43
    Brad
    0

    Tim

    The version is 3.0.9

    The Umbraco version is 6.0.0

    And if it matters I have courier installed too.

    That is version 2.7.5.1.90. 


  • Brad Richardson 22 posts 42 karma points
    Apr 06, 2013 @ 02:54
    Brad Richardson
    0

    I would love to know about this too. I am running Umbraco Contour 3.0.9 on Umbraco 6.0.3 with the Contour Contrib 0.0.6 package installed.

    The upload field is functioning properly from the visitor stand point. You can select a file and submit the form. However, the file does not get saved to the server, does not show up in the results, and does not have a link produced in the workflow emails.

    This makes this system very hard to use in every situation.

    Thanks,
    Brad 

  • Brad 94 posts 151 karma points
    Apr 09, 2013 @ 03:03
    Brad
    0

    Yep. Same here.. The upload field looks correct on the site, performs like a file uploader, gets no errors and the form submits..

    But, from there Contour seems to ignore the file.

    Does ANYONE have this working?

     

     

     

  • Brad Richardson 22 posts 42 karma points
    Apr 09, 2013 @ 07:54
    Brad Richardson
    0

    I was able to figure out what was causing this error:  Adding the form to the TinyMCE using the Insert Macro Form from Contour (Razor) option.

    Once I switched it to the Usercontrol option, the File Upload fields were able to validate while being mandatory and they actually saved a file to the server. Of course, you would want to use the XSLT Transformed Email to make the files actually link, otherwise it will simply give you a file location and no way of using it.

    Here is the code that I used (you can find this in different places, but I wanted to help...):

     

    <?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:param name="sortBy" />

    <xsl:template match="/">

        <div style="font: normal normal 13px/21px Trebuchet MS, Arial, sans-serif;">

          <p style="margin-bottom: 15px;">A visitor of your website submitted a form. Below are the submission details:</p>

    <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; font: normal normal 13px/21px Trebuchet MS, Arial, sans-serif;">

                <xsl:for-each select="$records//fields/child::*">
    <xsl:sort select="@pageindex" data-type="number" order="ascending" />
    <xsl:sort select="@fieldsetindex" data-type="number" order="ascending" />
    <xsl:sort select="@sortorder" data-type="number" order="ascending" />

                    <tr style="padding-bottom: 5px;">
        <td valign="top">

                            <xsl:choose>
        <xsl:when test="contains(./caption, 'Are you human?')"></xsl:when>
        <xsl:otherwise>
    <strong><xsl:value-of select="./caption" /></strong>
        </xsl:otherwise>
    </xsl:choose>

                        </td>
        <td valign="top">

                           <xsl:choose>

        <xsl:when test="contains(.//value, '/umbraco/plugins/umbracoContour/files/')">
    <a href="http://{umbraco.library:RequestServerVariables('SERVER_NAME')}{.//value}">
        <xsl:value-of select=".//value"/>
    </a>
        </xsl:when>
        <xsl:when test="contains(./caption, 'Are you human?')"></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>

        </div>

    </xsl:template>

    </xsl:stylesheet>

     

  • Comment author was deleted

    Apr 09, 2013 @ 10:57

    Thanks for the extra details Brad, I'll take a look at the razor macro when using it in the RTE

  • Comment author was deleted

    Apr 09, 2013 @ 11:05

    Found out why this is happening

    It happens when you have a form with runat server attribute and the Contour macro (razor one) is inside that.

    The razor macro will add a form of it's own so nested forms will result in unexpected behaviour.

    If you need the form with runat server attribute then use the usercontrol Contour macro, else make sure you don't end up with nested forms

    Regards,
    Tim 

  • Brad Ford 34 posts 75 karma points
    Apr 11, 2013 @ 01:06
    Brad Ford
    0

    Tim

    So close but alas not a solution. 

    I removed the Razor version of the form and used the UserControl version.  Publish and refreshed my page. The File uploaded but the Entries display does not create a link to the file. It shows it. Great, but that is of no use to my non savvy users.

     

     

    Brad

     

     

  • Comment author was deleted

    Apr 15, 2013 @ 11:10

    Ok looks like it's a bug then since it should render a link

    Added to our issue tracker, http://issues.umbraco.org/issue/CON-330 taking a look now so will be part of the next maintenance release (3.0.10)

  • Comment author was deleted

    Apr 15, 2013 @ 11:13

    Ok think I found the fix, just testing now

  • Comment author was deleted

    Apr 15, 2013 @ 11:24
  • Comment author was deleted

    Apr 15, 2013 @ 11:25

    Or it's also simple to patch just open the file 

    \Umbraco\plugins\umbracoContour\editFormEntries.aspx

    and find the line  if($(this).html().indexOf("~/umbraco/plugins") != -1){

    and then remove the ~ in that line

  • Alvin Tran 4 posts 44 karma points
    Apr 17, 2013 @ 16:16
    Alvin Tran
    0

    Hi Tim,

    We're experiance the same problems when using a razor form and having an upload field. The solution beneath suggests using the usercontrol version. Here's the big problem. Our customer needs to have a upload field and needs conditional logic. CL can only be used when using razor. This is quit a big issue. Do you have any suggestions how to use both?

  • Comment author was deleted

    Apr 17, 2013 @ 16:46

    Hi Alvin,

    Well you just need to make sure you don't place the razor macro inside a form with runat server attribute since that will mess things up...

    (razor macro will add it's own form so you don't want to end up with nested forms)

  • Jos Zwiers 1 post 23 karma points
    Apr 18, 2013 @ 11:16
    Jos Zwiers
    2

    If you add  enctype="multipart/form-data" to your runat server form you can use a overlapping form (this would be needed when you have macro's that require this on different parts of the form). The enctype you can add dynamicly to the form if a upload control is added using javascript.

    The contour razor scripting seems to detect the form because in the source there is only 1 form tag present, so the form in a form is not an issue.

     

  • Jamie Attwood 206 posts 500 karma points c-trib
    Sep 13, 2013 @ 22:41
    Jamie Attwood
    0

    I too experienced this issue (empty upload fields). Of course, there are no errors on the user side, and no documentation. I can't recall one site that I have built in umbraco where I did not surround most of my code in <form runat="server"> due to inline site search boxes, multiple embedded forms for login, etc.  In my situation, I needed to use the Razor version as I am customizing the form layout and don't want to continually deal with copying dlls all over the place. So, if you add enctype="multipart/form-data" (as Jos suggests above) to your wrapper form runat=server everything should work even though there is nested forms. Alternately you can try the .NET empty form hack: <form></form> directly below your opening <form runat="server">. This allows nested forms...

  • Steve 472 posts 1216 karma points
    Dec 11, 2014 @ 18:34
    Steve
    0

    Thank YOU Jos!!!! I've been asking this question for a LONG time, and I just stumbled upon your solution! I will be posting this solution on my question as well. Thank you again!!

     add  enctype="multipart/form-data" to your runat server form wrapper on the template

Please Sign in or register to post replies

Write your reply to:

Draft