PHP Check Upload File

Discussion in 'XML Forums' started by serialkisser, Apr 10, 2013.

  1. serialkisser

    serialkisser New Member

    I have manage to successfully create a upload page in php.Now:After the user click on the button for upload, I want to check to see if it is a xml file.If so, I want to upload to my server directory, and rename it. I read some w3school stuff earlier but I couldn't get it working.Can someone please help me?\[code\]<?php echo '<center>'; //Upload Backup echo "<strong>Upload Backup</strong>"; echo "<br><br>"; echo '<form action="u_backup.php" method="post" enctype="multipart/form-data">'; echo '<label for="file">Filename:</label>'; echo '<input type="file" name="file" id="file">'; echo '<h1>'; echo '<button type="submit">Apply</button>'; echo '</h1>'; echo '</form>'; echo '</center>';?>\[/code\]normally in form if its text field i can do isset($_POST['data']), but how do I check if the upload file exists?
     

Share This Page