Uploadify_ loading speed and other problems _ solution

Source: Internet
Author: User

1. ButtonText property setting Chinese invalid problem or loading speed is slow (2 seconds or so)


Cause: Uploadify.js is encoded using escape (), decoded using unescape () in uploadify.swf, and the Escape () method in JS is encoded using the ISO Latin character set for the specified string. It is obvious that our Chinese, including Japanese, Korean (CJK), are not included in the ISO Latin character set.


Workaround:


A. Modifying plugins


Modify Uploadify.js


The IF (settings.buttontext) Data.buttontext = Escape (Settings.buttontext);


Change to if (settings.buttontext) Data.buttontext = encodeURI (Settings.buttontext);


Modify Uploadify.fla


Will browseBtn.empty.buttonText.text = unescape (Param.buttontext);


Change to BrowseBtn.empty.buttonText.text = decodeURI (Param.buttontext);


Then regenerate the uploadify.swf and copy it into the project


B. Using the buttonimg parameter


Obviously buttonimg is used to set the picture button, their own pictures, no coding of course not garbled, but this method, the button display will be a bit slow, or a comparison of recommended method A.



2. The upload icon in Firefox is not visible


Cause: No plug-in for flash non IE kernel installed


Workaround: Install the latest version of the non-ie kernel plugin in Firefox



3. onqueuefull function Hint two times


Cause: In Uploadify.js, 157 lines have been prompted, so in the page set Onqueuefull will pop up two times prompt


Workaround: Move the uploadify.js in alert (' The queue is full. The max size is ' + Queuesizelimit + '. '); Delete or change the prompt to Chinese;



4. Uploadify.js in Chinese characters (do not modify uploadify.js this happens)


Reason: Coding is not unified, Uploadify.js uses UTF-8 encoding, ASP. NET environment defaults to GB2312 encoding


Workaround: Add charset= "gb2312" when referencing Uploadify.js



5. Http error when uploading a file with Chinese name


Reason: Using UTF-8 encoding and uploading images in uploadify.swf, ASP. GB2312 encoded by default


Workaround:


A. Add a context to the httphander process when uploading images. response.contentencoding = System.Text.Encoding.UTF8;


B. Add the following code in Web. config


<globalization fileencoding= "UTF-8" requestencoding= "UTF-8" responseencoding= "UTF-8"/>



6. The image disappears automatically after the upload is successful


Cause: In line 48th of Uploadify.js, there is a property: removecompleted The default value of this property is true; indicates that the file that was successfully uploaded was removed automatically


Workaround: Modify the removecompleted default value to False


Button displays Chinese


Method One:

Uploadify has a parameter is ButtonText this no matter how you do not support Chinese, because the plugin in JS with a transcoding method to the value of this parameter to the code, decoding the place in the SWF file, see Code, so this road does not. Another parameter, rarely mentioned on the Internet, is buttonimg (button picture), then you can completely use a picture to replace the plug-in with the Black Flash browse button, as long as your own picture is Chinese, this does not solve the Chinese button problem? If only add this one, you will find your button picture below there is a white area, in fact, that Flash left, white area indicates the mouse available range, this range can be adjusted with Width,height. There is also a parameter wmode its default value is opaque, change it to transparent on the line, that is, the white area of transparency. Then use the method that you just said, set the button click Range to be as big as your picture is completely OK.

Method Two:

The button for the Uploadify control does not support multiple languages, and here's how to modify it to support multiple languages.

1.jquery.uploadify.v2.1.4.js file 70 Lines

Original code: if (settings.buttontext) Data.buttontext = escape(Settings.buttontext);

New code: if (settings.buttontext) Data.buttontext = encodeURI(settings.buttontext);

2.jquery.uploadify.v2.1.4.min.js File 863 columns

Original code: if (f.buttontext) {g.buttontext=escape(F.buttontext)}

New code: if (f.buttontext) {g.buttontext=encodeURI(F.buttontext)}

3.uploadify.fla file Scene 1 script file 117 lines

Original code: BrowseBtn.empty.buttonText.text = unescape(param.buttontext);

New code: BrowseBtn.empty.buttonText.text = decodeURI(param.buttontext);

4.uploadify.fla file Scene 1>empty>buttontext properties > Characters > Series

Original value:Helvetica

New value:_sans

5.UPLOADIFY.FLA file Delete (delete) Scene 1>helvetica


Uploadify_ loading speed and other problems _ solution

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.