Copied to clipboard

Flag this post as spam?

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


  • Mreid 7 posts 27 karma points
    Sep 23, 2010 @ 23:49
    Mreid
    0

    Doc2Form empty upload field error

    Hi,

    I've started using the Doc2Form package and it's fantastic! I have a simple enquiry form that needs to include the possibility of adding an attachment and then sending that via email to my site admin. I have this working by using the upload datatype. However, I run into a problem when the user chooses not to upload a file. The upload field needs to be optional for my purposes. The error I get is as follows:

    [NullReferenceException: Object reference not set to an instance of an object.]
       umbraco.editorControls.uploadField.Save() +4904

    I am using Umbraco 4.5.2 and version 3.0 of Doc2Form. So, just to be clear... everything works perfectly if the user adds an attachment. The problem only occurs if the user doesn't upload a file.

    Any help is much appreciated!

  • sun 403 posts 395 karma points
    Oct 15, 2010 @ 06:52
    sun
    0

    I don't know why there is  no changes in this package so long time.

  • Cecilie Tveter 7 posts 27 karma points
    Oct 23, 2010 @ 14:44
    Cecilie Tveter
    0

    Did you figure thos out? I have the same prblem.

  • Mreid 7 posts 27 karma points
    Oct 26, 2010 @ 12:55
    Mreid
    0

    probably not the best solution but I "fixed" it by putting a try/catch statement around the following command in /app_code/doc2form.ascx.cs:

    try
    {
    df.DataEditor.Save();
    }
    catch { }

    this allows the script to continue even when the upload field is empty. 

     

  • Ambert van Unen 54 posts 96 karma points
    May 02, 2011 @ 10:13
    Ambert van Unen
    0

    Cheers! That should work!

     

    Only thing is... I've edited this in the source code, and (as far as I know) I should uploade the Doc2Form.dll as the  codebehind is inside that part... Only for the already installed Doc2Form, I can't find the DLL... You know anything about it ?

     

    Edit : Also, when I upload the DLL, I'm getting a cache directive error on the website where I've used the Doc2Form..

  • Mreid 7 posts 27 karma points
    May 03, 2011 @ 17:17
    Mreid
    0

    As far as I remember I only modified the /app_code/doc2form.ascx.cs file. I didn't make any modifications to the DLL. it was some time ago however...

  • Ambert van Unen 54 posts 96 karma points
    May 04, 2011 @ 10:09
    Ambert van Unen
    0

    It may be my lack of knowledge of pure asp.net programming... But as far as I know the .cs file is compiled into a .dll... in the .ascx is only the frontend of the code.

     

    please DO correct me if I'm wrong

  • Mreid 7 posts 27 karma points
    May 17, 2011 @ 11:53
    Mreid
    0

    Did you get this working?

  • Ambert van Unen 54 posts 96 karma points
    May 17, 2011 @ 12:10
    Ambert van Unen
    0

    Still a no... As I compile it turns the backside of the code into a .dll, if I upload it, it results into a cannot load XSLT error :(

  • Mreid 7 posts 27 karma points
    May 19, 2011 @ 23:59
    Mreid
    0

    are you sure the xslt error is related to the modified .cs file? can you tell me how you're adding the macro to your page please?

  • Ambert van Unen 54 posts 96 karma points
    May 23, 2011 @ 10:28
    Ambert van Unen
    0

    As soon as I upload the Doc2Form.dll I'm getting this error :

     

    Error creating usercontrol (/usercontrols/Doc2Form/Doc2Form.ascx)
    The type 'BCTLLC.UmbracoExtensions.Doc2Form' is ambiguous: it could come from assembly 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\dd3cc87c\5b22548a\App_Code.48kkonrl.DLL' or from assembly 'C:\Inetpub\vhosts\kraamzorglc.nl\httpdocs\bin\Doc2Form.DLL'. Please specify the assembly explicitly in the type name.

    I can understand that its ambigious... But I''ve got no idea how to fix it...

  • Ambert van Unen 54 posts 96 karma points
    Jul 26, 2012 @ 16:04
    Ambert van Unen
    0

    Looking back a year later where I learned much, theres simply a doc2form.ascx.cs in de app_code folder after installing.

    Using Mreid's solution:

    try
    {
    df.DataEditor.Save();
    }
    catch {}

    this error got easily fixed.. ;)

Please Sign in or register to post replies

Write your reply to:

Draft