Picture (file) upload (browser+php) ____php

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.