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.
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.
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
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 :)
How did you create this file upload control? I didn't saw it in the macro properties page
Hi,
I added the upload field to the doctype that contains al my form fields.
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.
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
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
is working on a reply...