[EdLUG] Help 6

Andrew Ramage andrew.ramage.1963 at gmail.com
Fri May 8 11:05:50 UTC 2020


When I select files, the upload starts, but I do not reach the first 
echo statement.  Can anyone tell me why ?

_HTML_

<form action="upload.php" method="post" enctype="multipart/form-data">
     <input type="file" name="fileToUpload" id="fileToUpload" multiple>
     <input type="submit" value="Upload music file" name="submit">
</form>

_upload.php_

<html>
<body>


<?php
$target_dir = "Music/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$audioFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));

// Check if file already exists
echo "First if";
if (file_exists($target_file)) {
     echo "Sorry, file already exists.";
     $uploadOk = 0;
}
__

_
_


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.edlug.org.uk/pipermail/edlug/attachments/20200508/208b80ef/attachment.html>


More information about the EdLUG mailing list