Check whether file is uploaded
<p>I have a page to add new article. Fields accepted from user are:</p>

<ul>
<li>article name</li>
<li>article content</li>
<li>article document (pdf file)</li>
<li>article cover image (image file)</li>
</ul>

<p>Creating the article is okay. I use HTTP POST with a multipart form for this. But when it has to be edited, I want to check if the files are uploaded. Edit-page contains same fields like above.</p>

<p>For name and content, I can check using <code>isset()</code> and <code>!empty()</code> functions. If both function fails, display a message to user.</p>

<p>What I want is, in edit-page, user can avoid uploading document and cover image. So, how to check if user had uploaded(selected a file for upload), at server side ? If user selected a new document or new cover image, I will remove old file and replace it with this new uploaded files. Otherwise, only change article name and article content in database. Skip file part, because user did not selected any files.</p>

<p>My question: how we check if user selected a new file ?</p>

<p>I am confused here. Please help.</p>
