Copied to clipboard

Flag this post as spam?

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


  • Martijn de Wolf 11 posts 32 karma points
    Apr 03, 2012 @ 09:02
    Martijn de Wolf
    0

    Upload field error when empty

    Hello, im having trouble with the upload field in my form. It works perfectly when i upload a image. But when the field is left empty and i submit the form. I get an error

    xception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 783:                    df.Data.PropertyId = dataProperty.Id;
    Line 784:
    Line 785:                   df.DataEditor.Save();
    Line 786:                    string dfFieldValue = df.Data.Value.ToString();
    Line 787:                    string dataPropertyName = dataProperty.PropertyType.Name;

    I have already tried to set df.DataEditor.Save(); between a try{}. But this didnt help.

    I hope anyone else solved this problem.

    Thanks in advance :)

  • Moran 285 posts 934 karma points
    May 25, 2013 @ 09:06
    Moran
    0

    How did you create this file upload control? I didn't saw it in the macro properties page

  • Martijn de Wolf 11 posts 32 karma points
    May 27, 2013 @ 08:47
    Martijn de Wolf
    0

    Hi,

    I added the upload field to the doctype that contains al my form fields.

     

  • Moran 285 posts 934 karma points
    May 28, 2013 @ 07:26
    Moran
    0

    Thanks

    Not really sure what you meant, just put it in the doc type? Wouldn't that will show up only in the back office? 

    I need this field to be visible to all the site's guests. 

  • Martijn de Wolf 11 posts 32 karma points
    May 28, 2013 @ 08:38
    Martijn de Wolf
    0

    If you add the Upload datatype to the DocType that contains your form fields it will show up in your form. (You have to select the doctype you want to display)

    For example this is how one of the doctypes i made looks like that contains the Upload datatype.

    Hope this helps.

    Cheers

  • Moran 285 posts 934 karma points
    May 28, 2013 @ 11:24
    Moran
    0

    Thanks
    But it's not exactly clear how how to upload the file and where can I find it once I uploaded it to the web site. I think the it's better to build a whole new user control for this form 

Please Sign in or register to post replies

Write your reply to:

Draft