Can I show a file upload field on an update form if no file already exists?
I have an insert form that contains 3 file upload fields. The user doesn't always upload all three files, but I would like them to be able to go back and upload them afterward using the update form. I'm clueless how to a) check if the file exists and b) display the file upload field if it doesn't. Here is the HTML for the update.php form:
<div class="lineGroup"> <label for="file1" class="sublabel" > file 1:</label>
<input name="file1" type="file" id="file1" size="30" tabindex="32" title="Please enter a value.">
</div>
<div class="lineGroup"> <label for="file2" class="sublabel" > file 2:</label>
<input name="file2" type="file" id="file2" size="30" tabindex="33" title="Please enter a value.">
</div>
<div class="lineGroup"> <label for="file3" class="sublabel" > file 3:</label>
<input name="file3" type="file" id="file3" size="30" tabindex="34" title="Please enter a value.">
</div>
Here's what's in my details.php page to display the files for downloading:
<tr>
<td class="DetailsSublabel">File 1</td>
<td class="DetailsPage"><a href="upload/<?php echo($WADAmrf_2021_details->getColumnVal("file1")); ?>"><?php echo($WADAmrf_2021_details->getColumnVal("file1")); ?></a></td>
</tr>
<tr>
<td class="DetailsSublabel">File 2</td>
<td class="DetailsPage"><a href="upload/<?php echo($WADAmrf_2021_details->getColumnVal("file2")); ?>"><?php echo($WADAmrf_2021_details->getColumnVal("file2")); ?></a></td>
</tr>
<tr>
<td class="DetailsSublabel">File 3</td>
<td class="DetailsPage"><a href="upload/<?php echo($WADAmrf_2021_details->getColumnVal("file3")); ?>"><?php echo($WADAmrf_2021_details->getColumnVal("file3")); ?></a></td>
</tr>
Basically, I'd like the link to the file if a file exists and a form field if no file exists. Alternately, it would be nice to be able to delete an existing file and upload a new on from the update.php page.
Is this nuts? Thanks!