title: Storing json in a hidden field to deserialize to a model property list
body: <p>Good morning all.  I've been pondering over the best way to use plupload with my mvc web app to marry up uploaded files with their respective record when created on the back-end.</p>
  
  <p>I've finally boiled it down to the following process - this will work for both new and existing records (think CMS):</p>
  
  <ol>
  <li>Create new record, use plupload to upload multiple files.</li>
  <li>Multiple files (series of json strings representing each file) are stored on the client then posted back via hidden field.</li>
  <li>A property on the model for the form holds the result of these uploaded files so I can handle the back-end business.</li>
  </ol>
  
  <p>The model (without the fluff of unrelated properties) will look like this:</p>
  
  <pre><code>public class Record{
      public IList&lt;ClientFile&gt; Files {get;set;}
  }
  </code></pre>
  
  <p>Client file looks like this:</p>
  
  <pre><code>public class ClientFile{
      public string UniqueId{get;set;}
  }
  </code></pre>
  
  <p>My problem lies with what I have on the client after each successful upload (a json string of ClientFile) and how I can correctly get this into hidden field and bound correctly so I can have the list of client files ready in my model.</p>
  
  <p>I'm thinking along the lines of either structuring the hidden field(s) right so the binder knows how to wire them up to the list, or having do some some custom deserializing myself to turn the collection of json strings into a list of objects.</p>
  
  <p>Does anyone have any wisdom before I lose my bank holiday weekend to mvc.</p>