Php+flash+jquery multiple pictures upload source sharing _php instance

Source: Internet
Author: User
Tags urlencode

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.

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.