This article mainly introduces php + flash + jQuery multi-image Upload implementation source code in detail, which has some reference value. if you are interested, you can refer to it.
Flash + php multi-image UploadSource code, test successful, a classic Upload source code, why use flash as the upload component, in fact, not only flash, but also jquery technology, the purpose of this operation is to better facilitate image management. kids shoes who have used QQ space to upload images know that QQ space has a good uploading experience and it is very convenient to manage our uploaded images, the flash and jquery technologies are basically used.
Flash + jquery is used for front-end image upload and display. it also needs to be combined with php to upload the image to the specified target. here, php has two files, one upload. php is the core code for uploading, index. php integrates flash + php + jquery technology, uploads submitted images to the Directory upload, and also has a folder images, which is called upload.swf flash file and jquery. now that the js file is ready, the technology has been implemented, and the rest is how to integrate it with the database. I will not explain it here.
:
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 ); // return data processing in js on the page $ filedata = array ('result' => 'true ', 'name' => $ _ FILES ['filedata'] ["name"], 'filepath' => $ uploadfile,); echo json_encode ($ Filedata); exit;
Index. php
Swfupload