Picture (file) upload. (Browser-side-> server-side)
Fundamentals: Selection: Input (Type=file), submitted: Sumbit (), server-side processing (php:move_upload_file)
Advanced: Multi-image upload, style, asynchronous, preview, Renaming (Chinese garbled), resizing,
plug-ins: uploadify (swf) or HTML5
compatibility:
to be added pit: browser to open SWF function (not query) or need browser support HTML5
demo
Sence:
config:2 to be
edited.
#uploadify插件 (dependent on flash plugin)
# #原理
# #实现步骤
-Download plugin
-browser End reference
-service-side configuration
Basic Implementation
principleUsing HTML input (type= "file") elements, adding files (Pictures), using form form method= "POST" enctype= "Mulitport/form_data" to process data on server server side ( Move_upload_file)
Demo
<!--browser end-->
<form method= "POST" enctype= "Multipart/form-data" action= "http://localhost/demo/" uploadify/index.php ">
<input type=" file "name=" F "/> <input" type= "hidden"
name= "T" value= "< ? PHP echo Date ("y-m-d h:i:s");?> "/>
<input type=" Submit "/>
</form>
Server-side
<?php
if (!empty ($_files)) {
$tempFile = $_files[' f '] [' tmp_name '];
$targetFile = __dir__. '/' . $_files[' f ' [' name '];
Move_uploaded_file ($tempFile, $targetFile);
Echo ' The Fiel is move to '. $targetFile;
}
? >
Advanced Implementation
principle
Demo
<!--browser End-->
Server-side
Attachment 1:uploadify 3.2 Parameter properties, events, method functions-Agesland-Blog Park
Appendix 2:uploadify Online Chinese Manual · Look at the Clouds