I want to add this option for my users. They will be presented with a "Browse" button, they can MULTI select different files. And once they are done selecting the files.I want to collect the file names alone without any upload and pass it onto my form action webpage. process.php
Basically, my program will work on the file names.
I've browsed several posts such as this How to Get File Name from Upload Form Using jQuery?. But wasn't able to put together my knowledge on jquery and php together. Also, creating a multi file upload.
MY ATTEMPT
<html>
<body>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
upload_file.php
<?php
if ($_FILES["file"]["error"] > 0) {
echo "Error: " . $_FILES["file"]["error"] . "<br>";
} else {
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
But this gives file name only AFTER upload is done. I do not know any other method.
Thank you for your answer.
Best Regards, John