locked
Sharepoint 2007 Custom field error : "Failed to get value of the "Attachments" column from the "Attachments" field type control" RRS feed

  • Question

  • Hi All

    I have created a custom field , with brows button to select a file and a button to upload the selected file to a selected sharepoint document list.

    now it works fine apart from the case where I have to fields of that type in one item and I select the same file to be uploaded (each field uploades to a different list)

    and I click the upload button in one of the fields , i get the error :

    "Failed to get value of the "Attachments" column from the "Attachments" field type control.  See details in log. Exception message: A file with the name already exists."

    now there is no Exception thrown in my code (which handles the code behind the field itself)

    there is no clue in the moss logs or the event viewer.

    by the way I do not upload any attachments (so the error seems to be not connected)

    in my debug code it pass the CreateChildControls , UpdateFieldValueInItem

    does not enter the validate event not the event of the button (all works in different scenario) and crashes with the above message.

    Tuesday, June 5, 2012 12:05 PM

Answers

  • Hi Patrik

    I solved the issue.

    insteed of using two buttons : browes and upload I use only one: browes and the js onchange event fires the hidden upload button.

    the rest of my problems with this custom field i solved with js.

    10x

    btw: did u know that sharepoint default behavior is to upload as attachment every file that is specified in an input type file control?

    Shlomy

    • Marked as answer by sakons Tuesday, June 12, 2012 4:48 AM
    Tuesday, June 12, 2012 4:47 AM

All replies

  • >> "now it works fine apart from the case where I have to fields of that type in one item and I select the same file to be uploaded (each field

    >> uploades to a different list)"

    Please clarify - is there any centralize location from where you are trying to uploaded attachments to different lists using a single button ?


    Warm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/ | Posting is provided "AS IS" with no warranties, and confers no rights

    Monday, June 11, 2012 7:52 PM
  • Hi Patrik

    I solved the issue.

    insteed of using two buttons : browes and upload I use only one: browes and the js onchange event fires the hidden upload button.

    the rest of my problems with this custom field i solved with js.

    10x

    btw: did u know that sharepoint default behavior is to upload as attachment every file that is specified in an input type file control?

    Shlomy

    • Marked as answer by sakons Tuesday, June 12, 2012 4:48 AM
    Tuesday, June 12, 2012 4:47 AM