flash+php More pictures upload The source code, test success, a classic upload source code, why use Flash as an upload component, in fact, here is not only flash, plus jquery technology, the purpose is to better manage the picture more convenient, Use of QQ space to upload pictures of children's shoes know that the QQ space upload experience is very good, and the management of our uploaded pictures is very convenient, the use of technology is basically flash and jquery technology.
Flash+jquery is as a front-end image upload display, but also need to combine with PHP to upload pictures to the specified target, here PHP has two files, a upload.php is the core code upload, index.php is the integration of flash+php+ The combination of jquery technology, will be submitted to the picture uploaded to the directory upload below, there is also a folder images, which is called upload.swf Flash files and jquery.js files, technology has been achieved, the rest is how to integrate with the database is very simple, here no longer detailed.
Effect Chart:
Key code:
upload.php
<?php
$uploaddir = ' upload/';
$filename = Date ("Ymdhis"). Rand (100,999);
$uploadfile = $uploaddir. $filename. substr ($_files[' filedata '] ["Name"],strrpos ($_files[' filedata '] ["name"], "."));
$temploadfile = $_files[' filedata '] [' tmp_name '];
Move_uploaded_file ($temploadfile, $uploadfile);
Returns the data on the page JS does processing
$filedata = Array (
' result ' => ' true ',
' name ' => $_files[' filedata '] [' name '],
' filepath ' => $uploadfile,
);
echo Json_encode ($filedata);
Exit
index.php
In fact, this combination of upload technology on many large Web sites have, more is applied in the picture management above, for example 51 space picture management, the basic function all is similar, the important must learn the flash and the PHP communication technology, in the large-scale development, this kind of technology will often appear.
SOURCE Download: Http://xiazai.jb51.net/201607/yuanma/php+flash (jb51.net). rar
For more highlights, please click on the "jquery Upload operation Summary" for in-depth study and research.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.