Ask for an example of php + ajax image upload! Files are not used. when you click <ahref = ""> upload image </a>, select this map

Source: Internet
Author: User
Please upload an image using php + ajax !!!!!!!!!!!!!!!!!!!!! When you click & lt; ahref = & quot; & gt; to upload an image & lt;/a & gt, click & lt; ahref = & quot. search for the php + ajax image Upload instance !!!!!!!!!!!!!!!!!!!!! Files are not used. when you click upload image, the map is selected.
Files is not used. when you click upload image, the box for selecting a local image is displayed. when you click OK, the upload image is called and the path of the uploaded image is returned.

------ Solution --------------------
First, select a local file. you have more than one local file on the network (only Internet Explorer is supported). second, file upload does not seem to support ajax. it can only be similar to ajax, such as iframe.
------ Solution --------------------
Right? Dz provides this Upload function. you only need to use it wherever you need it.
------ Solution --------------------
It is relatively simple to hide A file. A simulates the file click and then uploads the file in iframe.

Try SWFUpload.
------ Solution --------------------
This example is everywhere ......

Http://www.phpclasses.org/package/2759-PHP-Browse-files-uploaded-without-page-reloading.html

Php classes unregistered users do not seem to be able to download. registered users will automatically subscribe to emails-> consider whether to register



There are a lot of similar classes in other places.
------ Solution --------------------
Find an existing change.

I remember that ajax cannot upload files, but it just looks like ajax. it actually generates an iframe.

We recommend swfupload for batch upload.
------ Solution --------------------
Pure ajax Upload, without iframe/swf, may only implement ff ...... Haha
------ Solution --------------------
Function showup (){

// Use a normal style
// Condition ('{mood_msg_menu'}.css ('display', 'block');. position ()
Var leftpos = $ ("# tu"). offset (). left + 15;
Var toppos = $ ("# tu"). offset (). top + 20;

// Obtain the position and determine the position of the dialog box
(('{Upload'}.css ('left', leftpos + 'px ');
Certificate ('{upload'}.css ('top', toppos + 'px ');
$ ('# Upload'). show ('normal ');
// $ ('# Mood_add ').
If ($ ('# mood_face_bg') {$ ('# mood_face_bg'). remove ();}
Var modDiv =''
$ ('# BaseParent'). append (modDiv );
}















For more information, see insert images on Weibo.
------ Solution --------------------
I used a self-written flash Upload.

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.