A basic tutorial is provided to show you that if you use the move_uploaded_file function to upload multiple images, you can also upload multiple files.
A basic tutorial is provided to show you that if you use the move_uploaded_file function to upload multiple images, you can also upload multiple files.
<Html>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Head>
<Title> Multifile upload </title>
</Head>
<Body>
<Form accept = "" method = "post" enctype = "multipart/form-data">
<Input type = "file" name = "img []"/> <br/>
<Input type = "file" name = "img []"/> <br/>
<Input type = "file" name = "img []"/> <br/>
<Input type = "file" name = "img []"/> <br/>
<Input type = "file" name = "img []"/> <br/>
<Input type = "file" name = "img []"/> <br/>
<Input type = "submit" name = "s"/> <br/>
</Form>
<? Php tutorial
// Upload File Information
$ Img = $ _ FILES ['img '];
If ($ img)
{
// File storage directory, which is the same as the PHP File
$ Dir = dirname (_ file __);
$ I = 0;
Foreach ($ img ['tmp _ name'] as $ value)
{
$ Filename = $ img ['name'] [$ I];
If ($ value)
{
$ Savepath = "$ dir $ filename ";
$ State = move_uploaded_file ($ value, $ savepath );
// If the upload is successful, preview
If ($ state)
{
Echo " ";
}
}
$ I ++;
}
}
?>
</Body>
</Html>