Methods and questions about using the jquery extension uploadify to upload files, jqueryuploadify

Source: Internet
Author: User

Methods and questions about using the jquery extension uploadify to upload files, jqueryuploadify

I am a student, and my major is not a computer, but I need to use a lot of related technologies. So I am working hard when the technical foundation is poor. Recently, a small project needs to upload images, and ajax is required. However, the ajax method using jquery always has the "C:/fakepath" problem. I have been searching for related solutions on the Internet for a long time, but it is too troublesome, or my level is not enough. However, some people say they can use jquery's file upload plug-in, So Baidu. Discovery. Here, I will record that, while helping myself learn, if I can help other friends, I am so happy!

The first is the download of uploadify. Baidu directly has two versions on the official website, one is the free flash version, and the other is the html5 version charged for $5. No one offered me reimbursement and chose the former.

You can also choose to add shards ).

The following is the code section!

1 <! DOCTYPE html> 2 
<?php$tmp_name=$_FILES["img"]["tmp_name"];$name=$_FILES["img"]["name"];$path="../img";$size=$_FILES["img"]["size"];if(move_uploaded_file($tmp_name,$path.'/'.$name)){    echo "1";}else{    echo "0";}

 

This is the final result I learned from many blogs and posts on the Internet (I need to pay attention to fileObjName and onUploadSuccess. It is said that they are the names of the new version, and the old versions are fileDataName and onComplete respectively ). The basic functions are implemented. However, during the test, when an upload error occurs, for example, if I select an image that exceeds the size limit, an English prompt will pop up!

So I am in line with the principle that "useful is a good method", in min. search for these sentences in js, and change the fixed part "Some files were not added to the queue:" and "the file", "exceeds the size limit" to Chinese, the effect is as follows:

If any errors or suggestions exist, please point them out! Thank you.

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.