I know this may sound relatively basic question, but still wanted to ask. I need to upload two files at once by creating two file input in my form one for each file. Until now I have used a basic script for testing to upload a single file.
I also found some examples how to upload muliple files, but in my case I am having two upload fields and I want the user to upload the two files. Once uploaded I wanted to save it onmy webserver. Any simple example would be of good help.
Thanks
It's simply just a case of changing the variable names and doing everything twice.
HTML:
<input type="file" name="filea" />
<input type="file" name="fileb" />
PHP:
$filea = $_FILES['filea'];
$fileb = $_FILES['fileb'];
move_uploaded_file($filea['tmp_name'], '/path/to/your/destination/'.$filea['name']);
Can you carry on from there?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With