Upload_err_oknoerroccurred. Upload successful upload tutorial. inifile. The maximum upload size is exceedsthemaximumvaluespecifiedbythe
Upload_err_ OK no error occurred. the upload is successful. Upload the uploaded file exceeds the maximum value specified in the php tutorial. ini file. the maximum upload size is exceeds the maximum value specified by
Upload_err_ OK no error occurred.
Uploaded
Upload_err_ini_size the uploaded file exceeds the maximum value specified in the php tutorial. ini file.
Maximum upload size exceeded
Upload_err_form_size the uploaded file exceeds the maximum value specified by the max_file_size hidden widget.
The maximum size of the form file is exceeded.
Upload_err_partial the file upload was canceled and only part of the file was uploaded.
Upload_err_nofile no file was uploaded.
File not uploaded
A simple file upload form
Instance 1
]
A file upload script
If (isset ($ _ files ['fupload']) {
Print "name:". $ _ files ['fupload'] ['name']."
";
Print "size:". $ _ files ['fupload'] ['SIZE']. "bytes
";
Print "temp name:". $ _ files ['fupload'] ['tmp _ name']."
";
Print "type:". $ _ files ['fupload'] ['type']."
";
Print "error:". $ _ files ['fupload'] ['error']."
";
If ($ _ files ['fupload'] ['type'] = "image/gif "){
$ Source = $ _ files ['fupload'] ['tmp _ name'];
$ Target = "upload/". $ _ files ['fupload'] ['name'];
Move_uploaded_file ($ source, $ target); // or die ("couldn't copy ");
$ Size = getimagesize ($ target );
$ Imgstr ="
$ Imgstr. = "src =" $ target "alt =" uploaded image "/>
";
Print $ imgstr;
}
}
?>
File Upload instance 2
$ Maxsize = 28480;
If (! $ Http_post_vars ['submit ']) {
$ Error = "";
}
If (! Is_uploaded_file ($ http_post_files ['upload _ file'] ['tmp _ name']) and! Isset ($ error )){
$ Error ="You must upload a file!
";
Unlink ($ http_post_files ['upload _ file'] ['tmp _ name']);
}
If ($ http_post_files ['upload _ file'] ['SIZE']> $ maxsize and! Isset ($ error )){
$ Error ="Error, file must be less than $ maxsize bytes.
";
Unlink ($ http_post_files ['upload _ file'] ['tmp _ name']);
}
If (! Isset ($ error )){
Move_uploaded_file ($ http_post_files ['upload _ file'] ['tmp _ name'],
"Uploads/". $ http_post_files ['upload _ file'] ['name']);
Print "thank you for your upload .";
Exit;
}
Else
{
Echo ("$ error ");
}
?>
Love Sharing? Php Image File Upload detailed analysis
Http://www.ihref.com/read-7059.html