none
Form Attachments Lost After Validation Postback RRS feed

  • Question

  • I have a problem in SharePoint 2007 (Enterprise) whereby the attachment gets lost during validation postback on a SharePoint form.   My SharePoint form has a required field on it.  As you know, SharePoint adds on a field validator to required fields on the NewForm.aspx.  Well, let's say the user adds an attachment, but forgets to enter the required field.  When the form is submitted, the validation occurs, the page is posted back with the error message, and VOILA - the attachment is no longer there.   Microsoft just didn't want to put this into the viewstate for a reason?  Or am I missing something?

    Anyhow, the behavior I want is this:  
       1) User attaches something
       2) User forgets to enter in a required field
       3) Validation occurs
       4) Page is posted back with required field prompt
       5) ATTACHMENT IS STILL THERE!

    Is there a way to do this somehow?
    Thursday, August 21, 2008 6:57 PM

All replies

  • I wanted to add that this form was not modified using SharePoint Designer - its completely out of the box. It is an unmodified form posting to a SharePoint list.
    Thursday, August 21, 2008 7:33 PM
  • I have this same problem.  Has anyone found a solution or workaround?

    My list is out of the box with zero customizations.  I have a number field that must be within a specific range.  If I have an attachment, and enter a number outside that number range, the webpage returns a validation error on submission (as it is supposed to) but I lose the attachment.

    Please advise.  Thanks in advance!

    Enterprise Portal Administrator
    Wednesday, September 3, 2008 1:27 PM
  • Hi,

    I have a similar issue but I have customised my form in SharePoint Designer.

    I am using drop down fields in my list and there is a bug when using these in a custom form where the out of the box validation doesn't work on drop down fields.

    Where my issue is the same ...

    I have added validation using SPD to 4 form fields (2 text boxes and 2 drop downs), and on testing I have found that if I enter data into two of the validated fields and submit the form, the validation error kicks in.  So I complete the data in the two errored fields and submit for a second time.

    The data from the first two fields does not get posted to the list item/record, but the second two do.  This is the same for any number of validated fields that are populated in the first submit attempt (whilst leaving at least one validated field empty).

    Sounds like a bug as I cannot see a problem with the way I have implemented the validation.

    Pete.
    Wednesday, September 9, 2009 2:55 PM
  • We too are losing attachments if a required field is missing...



    attachment 'stick's and passes through to item as long as no redisplay due to missing required field....

    Seems to still be an issue and no proposed solutions....

    Any resolution ?
    Wednesday, November 18, 2009 6:06 PM
  • I just ran into this issue today.  I can't believe it took this long for a user to point this out to me.  Has anyone figured out a workaround for this BUG?  Another question is ... has this been fixed in 2010?  Can it be another reason to get behind the push to upgrade to SP 2010?

    Thanks in advanced for any response.

    Tom
    Monday, March 1, 2010 8:12 PM
  • We just ran into this issue as well - It's strange that Microsoft has not addressed this issue yet. Did anybody find a workaround or even hotfix for this?

    Thanks,
    Tom.

    Thursday, May 13, 2010 10:42 PM
  • Sorry to awake an old thread but it would seem this still hasn't been fixed or am i missing something? I badly need a solution to this problem.

     

    We are using SharePoint Server 2010 Enterprise and it is not working OOTB.

     

    Thanks,

    Mark

    Monday, November 28, 2011 2:21 PM
  • Our users face a similar issue in our 2007 environment. It looks like a simple issue behind a complex method. Michael Greene details his findings here, on how SharePoint List attachments work.
    Monday, December 5, 2011 8:58 PM
  • It's 2019...

    I'm posting here that this issue is still persisting till now in 2019 on SharePoint 2013.

    No luck to find workarounds.


     

    Wednesday, April 17, 2019 8:59 PM