title: Is there a way to update a custom field in Wordpress with a front-end file upload?
body: <p>I am trying to update a custom WordPress-field with a file upload from a front-end form.</p>
  <p>Example:</p>
  <pre><code>&lt;form action=&quot;submit&quot;&gt;&lt;input type=&quot;file&quot; name=&quot;file_upload&quot;&gt;&lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;&lt;/form&gt;
  </code></pre>
  <p>Now I am looking for the php code that updates the custom field (file upload) in WordPress named 'file_upload' of a post with a certain ID. The plugin I use is 'Advanced Custom Fields'.</p>
  <p>EDIT:<br>
  I get the file via an $_FILES request in PhP:</p>
  <pre><code>$file_upload = $_FILES['file_upload'];
  </code></pre>
  <p>Then I try to handle the upload via this method:</p>
  <pre><code>$file_upload_id = media_handle_upload( $file_upload, 0 );
  </code></pre>
  <p>Is this the right way to do it?</p>