close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Can I show a file upload field on an update form if no file already exists?

Thread began 4/05/2022 2:44 pm by art226587 | Last modified 4/26/2022 2:39 pm by art226587 | 90 views | 10 replies

art226587

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!

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...