Home Web Front-end JS Tutorial Several problems encountered when using webuoploader

Several problems encountered when using webuoploader

Jun 27, 2017 pm 02:42 PM
web upload document Click choose

Recently I was working on a project for the company’s official website. There is a function to upload ID photos, which is actually a function to upload pictures. Xiaomeng used Baidu’s plug-in WebUploader to do it. Why use this plug-in? The reason is: WebUploader is a simple modern file upload component based on HTML5 and supplemented by FLASH. It can give full play to the advantages of HTML5 in modern browsers without abandoning the mainstream IE browser. It uses the original FLASH runtime and is compatible with IE6+, iOS 6+, android 4+. The two sets of runtimes have the same calling method and can be selected by the user. Another point is the use of concurrent uploading of large files in fragments, which greatly improves the efficiency of file uploading. Based on these advantages, Xiaomeng chose this plug-in.

As for how to use webuploader, today I will introduce several problems that Xiaomeng encountered when using webuoploader when working on the official website project.

Problem 1: WebUploader In some browsers such as chrome, when you click to upload a file, the selection box will delay for a few seconds before displaying, and the response is very slow

When I first encountered this problem, Xiaomeng I thought it was because of the slow network speed, so I didn’t worry too much about it. Later I found out that it wasn’t, so I threw the test address to Xiaodai and asked him if the speed was slower there. It turned out that it really wasn’t from the network. Problem, I checked the API of webuploader and found nothing. Then Xiaodai found a solution in github. Change one of the parameters when the webuploader is initialized:

1

2

3

4

5

accept: {

 title: 'Images',

 extensions: 'jpg,jpeg,png',

 mimeTypes: 'image/*'

}

Copy after login

1

2

3

4

5

accept: {

 title: 'Images',

 extensions: 'jpg,jpeg,png',

 mimeTypes: 'image/jpg,image/jpeg,image/png'   //修改位置

}

Copy after login

This method is a little bit It's simple and crude. After reading it, I realized that webuploader will retrieve all formats if * is defined. The reason for modifying this parameter is to selectively scan file types, and only choose to scan the types you set. Xiaomeng tried it, and after the modification, there was indeed no delay. However, this did not happen when Xiaomeng first used webuploader, and the DEMO on the official website of webuploader also did not delay. Some people explained that it was because of Google Browser updates, chrome 52.0.2743.80 and above will cause delays, but Xiaomeng doesn't understand why there is no delay in the DEMO on the official website. But there is little point in dwelling on this issue, we aim to solve it. Then this problem can be modified like this.

Problem 2: WebUploader Firefox browser does not respond when clicking to upload files

This problem is actually more serious than problem 1. Even if the response is slow, I can wait, but there is no response at all. I'm so confused, what should I do... Oh, what should I do... Why can't you use Firefox? It's hurting me. You're making me short of breath in front of you. I want to uninstall you... All kinds of Baidu have no results, and I'm so frustrated. Please help me find a solution on github. Later, I saw someone saying that it might be because the upload button uses a button, and it was recommended to change it to a div. I made some modifications, and the problem was indeed solved. It was said that it was a problem with Firefox's support for button buttons, so this situation occurred. Although I don't know why this happened, but the problem was solved.

Question 3: WebUploader Some low version IE browsers have no response when clicking to upload files

Regarding the IE problem, in fact, some companies are willful and do not consider IE compatibility, so you can ignore it. This is because IE does not support html5 upload. Although webuploader has the function of "by default, it will first try to see if html5 is supported, and if it is supported, use html5, otherwise use flash." However, for browsers like IE, there are some problems that you really don't have. The method explains why, so if you encounter this problem, you can set the value of runtimeOrder to flash to force the use of flash running. However, there is no need to worry about setting the default setting to flash to run the upload, which will affect its speed. Webuploader handles this very well.

Here, this article ends. I wonder if any friends have encountered the same problem as me. Xiaomeng recorded this. One is to remind myself, and the other is to hope to help those in need. Friends who solve these problems. If you like it, give Xiaomeng a like, O(∩_∩)OThank you


The above is the detailed content of Several problems encountered when using webuoploader. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Can wallpaper engine be shared among families? Can wallpaper engine be shared among families? Mar 18, 2024 pm 07:28 PM

Does Wallpaper support family sharing? Unfortunately, it cannot be supported. Still, we have solutions. For example, you can purchase with a small account or download the software and wallpapers from a large account first, and then change to the small account. Simply launching the software is perfectly fine. Can wallpaperengine be family shared? Answer: Wallpaper does not currently support the family sharing function. 1. It is understood that WallpaperEngine does not seem to be suitable for family sharing environments. 2. In order to solve this problem, it is recommended that you consider purchasing a new account; 3. Or download the required software and wallpapers in the main account first, and then switch to other accounts. 4. Just open the software with a light click and it will be fine. 5. You can view the properties on the above web page"

How to set lock screen wallpaper on wallpaper engine? How to use wallpaper engine How to set lock screen wallpaper on wallpaper engine? How to use wallpaper engine Mar 13, 2024 pm 08:07 PM

WallpaperEngine is a software commonly used to set desktop wallpapers. Users can search for their favorite pictures in WallpaperEngine to generate desktop wallpapers. It also supports adding pictures from the computer to WallpaperEngine to set them as computer wallpapers. Let’s take a look at how wallpaperengine sets the lock screen wallpaper. Wallpaperengine setting lock screen wallpaper tutorial 1. First enter the software, then select installed, and click "Configure Wallpaper Options". 2. After selecting the wallpaper in separate settings, you need to click OK on the lower right. 3. Then click on the settings and preview above. 4. Next

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. Mar 21, 2024 pm 09:17 PM

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? Mar 14, 2024 pm 02:07 PM

Quark Netdisk and Baidu Netdisk are currently the most commonly used Netdisk software for storing files. If you want to save the files in Quark Netdisk to Baidu Netdisk, how do you do it? In this issue, the editor has compiled the tutorial steps for transferring files from Quark Network Disk computer to Baidu Network Disk. Let’s take a look at how to operate it. How to save Quark network disk files to Baidu network disk? To transfer files from Quark Network Disk to Baidu Network Disk, you first need to download the required files from Quark Network Disk, then select the target folder in the Baidu Network Disk client and open it. Then, drag and drop the files downloaded from Quark Cloud Disk into the folder opened by the Baidu Cloud Disk client, or use the upload function to add the files to Baidu Cloud Disk. Make sure to check whether the file was successfully transferred in Baidu Cloud Disk after the upload is completed. That's it

Is there any virus when watching wallpaper engine movies? Is there any virus when watching wallpaper engine movies? Mar 18, 2024 pm 07:28 PM

Users can download various wallpapers when using WallpaperEngine, and can also use dynamic wallpapers. Many users do not know whether there are viruses when watching videos on WallpaperEngine, but video files cannot be used as viruses. Is there any virus when watching movies on wallpaperengine? Answer: No. 1. Just video files cannot be used as viruses. 2. Just make sure to download videos from trusted sources and maintain computer security measures to avoid the risk of virus infection. 3. Application wallpapers are in apk format, and apk may carry Trojan viruses. 4. WallpaperEngine itself does not have viruses, but some application wallpapers in the creative workshop may have viruses.

What is hiberfil.sys file? Can hiberfil.sys be deleted? What is hiberfil.sys file? Can hiberfil.sys be deleted? Mar 15, 2024 am 09:49 AM

Recently, many netizens have asked the editor, what is the file hiberfil.sys? Can hiberfil.sys take up a lot of C drive space and be deleted? The editor can tell you that the hiberfil.sys file can be deleted. Let’s take a look at the details below. hiberfil.sys is a hidden file in the Windows system and also a system hibernation file. It is usually stored in the root directory of the C drive, and its size is equivalent to the size of the system's installed memory. This file is used when the computer is hibernated and contains the memory data of the current system so that it can be quickly restored to the previous state during recovery. Since its size is equal to the memory capacity, it may take up a larger amount of hard drive space. hiber

In which folder are the wallpapers of wallpaper engine located? In which folder are the wallpapers of wallpaper engine located? Mar 19, 2024 am 08:16 AM

When using wallpaper, users can download various wallpapers they like for use. Many users do not know which folder the wallpapers are in. The wallpapers downloaded by users are stored in the content folder. Which folder is the wallpaper in? Answer: content folder. 1. Open File Explorer. 2. Click "This PC" on the left. 3. Find the "STEAM" folder. 4. Select "steamapps". 5. Click “workshop”. 6. Find the “content” folder.

Does wallpaper engine consume a lot of power? Does wallpaper engine consume a lot of power? Mar 18, 2024 pm 08:30 PM

Users can change their computer wallpapers when using WallpaperEngine. Many users don't know that WallpaperEngine consumes a lot of power. Dynamic wallpapers consume a little more power than static wallpapers, but not a lot. Does wallpaperengine consume a lot of power? Answer: Not much. 1. Dynamic wallpapers consume a little more power than static wallpapers, but not a lot. 2. Turning on dynamic wallpaper will increase the computer's power consumption and take away a small amount of memory usage. 3. Users do not need to worry about the serious power consumption of dynamic wallpapers.

See all articles