Php multi-file upload code implementation php multi-file upload function this article uses php multi-File Upload class implementation, and provides an example of php multi-File Upload instance, multi-file Upload is the most important thing about file attributes, which must be in the form of arrays and read by foreach or for. Then, you can use move_uploaded_file to upload files to the server.
Php multi-file upload code for php multi-File Upload
This article uses php multi-File Upload class for implementation, and provides examples of php multi-file upload, multi-file Upload is the most important thing about file attributes, which must be in the form of arrays and read by foreach or for. Then, you can use move_uploaded_file to upload files to the server.
*/
?>
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<Html xmlns = "http://www.bKjia. c0m/1999/xhtml">
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312"/>
<Title> php multi-file upload code </title>
</Head>
<Body>
<Form method = "post" enctype = "multipart/form-data" action = "server. php">
<Input type = "file" name = "spec []">
<Input type = "file" name = "spec []">
<! -- <Input type = "file" name = "spec">
<Input type = "file" name = "manual"> -->
<Input type = "submit">
</Form>
</Body>
</Html>
Server. php
<? Php
// Upload array files
Include 'upload. class. php ';
$ U = new upload ('../uploads/product/', 'spec ', 'group ');
Print_r ($ u-> getnewname ());
Echo $ u-> geterror ();
/***********************
// Upload single file
$ U = new upload ('../www. bKjia. c0m/product/', 'spec ');
Print_r ($ u-> getnewname ());
$ U = new upload ('../mb. bKjia. c0m/product/', 'manual ');
Print_r ($ u-> getnewname ());
Echo $ u-> geterror ();
************************/
?>
1 2