PHP upload breakpoint continue to pass

Source: Internet
Author: User
Does not use the control, as if it can only be implemented with Flash?


Reply to discussion (solution)

Of course it is. PHP doesn't support it.

Does not use the control, as if it can only be implemented with Flash? No controls are basically not implemented. You can see the QQ mailbox inside the large attachment upload function, Baidu network disk, Dbank (Huawei Network Disk), 115 network disk, 360 network disk their breakpoint continuation is all self-developed control to achieve. Instead of using flash to achieve this.

Does not use the control, as if it can only be implemented with Flash? In a real-world network environment, files around 30MB need to be implemented using controls. On the one hand because the domestic network environment is not very stable, on the other hand, from the server load considerations.
In general, some of our website users may use the network of telecommunications, some with the network of Unicom, some with the education network, some in the south of some in the north, this complex network environment causes them to visit the site speed is different. Some users fast speed, such as telecommunications users to access the telecommunications room must be fast, he uploaded large files may be no problem. But Unicom's visit to the telecommunications engine room may be slow, he uploaded large files may appear upload timeout, drop lines and other issues.

Server load problem, now the normal file upload technology on the service side of the pressure is still very large. Ordinary HTML upload 1G files, the server needs to allocate 1G of memory first, and then open a long connection has been waiting for the customer upload completed. In this period, if there are other users to upload 1G files, then the server will allocate 1G of memory. It can be imagined that if the user is more, the server must not carry the hanging. Even with flash, such as SWFUpload and several other flash controls, they use the same technology as normal HTML.

Tencent they were thinking about the problem, so use the controls to solve the problem. They use a control to divide a large file, such as 1G, into small chunks, each of which is about 128KB, and then loop through the upload until it is finished uploading. The advantage of this is to reduce the pressure on the service side, improve the load capacity of the service side, so that the server can handle more user requests. Also cost savings.

Does not use the control, as if it can only be implemented with Flash? The traditional HTML method has been difficult to meet the large file upload. Don't say it is 100MB,50MB to the server is very large, service not only to open a socket connection has been waiting for this file upload completed, but also to allocate the same size of memory to save the file on the server caused by the pressure is quite large, And the pressure will increase with the increase of the user geometry. Even if it is not with Flash, because the current flash does not support the continuation of the breakpoint operation, also does not support file block operation, Flash and the traditional way of HTML upload principle. Upload 100MB images with flash, and the server will allocate 100MB of memory. 10 users upload 100MB data at the same time, will eat server 1G of memory.
Flash upload is the entire file is truncated into memory, this is a serious problem. Because if the user is uploading 5G files, Flash will load all 5G files into memory. This can seriously affect the user's operational experience. Because then the user's computer will be in suspended animation state. The average user's computer is also 2G, so hang up directly, out of memory, or memory overflow.

Some friends have tried to upload large files with the Flash file upload control, but often encounter upload time-outs, or upload errors. This is because the Flash file upload control now uses the same technology as the traditional HTML upload. Let the server open a connection and wait until the client has finished sending the file. However, in the actual network environment, the user's speed may be only 50kb/s, uploading 200MB files may take 2.8 hours. However, the server session connection is not possible for the user for 2.8 hours, this does not consider the complex network environment, such as packet loss situation. If you encounter packet loss and network anomalies, the 100MB file in front of the user is white. This equates to a waste of one hours of user time. Bring a very poor experience to the user.
For the server, the connection resource is very limited, even if the server can be a user for 2.8 hours, if the user access a large, each user occupied a connection and take so long, then the server's concurrency processing power is very low. Other users are asked to request a simple 1KB HTML page and must wait for the server to finish processing the previous user's request.

At the same time Flash can not meet the large file upload requirements. Because of the large file upload requirements have a requirement is to ensure the stability of data transmission. For example, the user uploads 1G files, has uploaded 500MB, then the network suddenly broke, but the user hope that the next time the file is uploaded from the location of the last upload to start the transmission, that is, from the location of the 500MB to start transmission, this demand is flash can not do.

Like QQ mailbox in the super-large attachment upload function, 115 network disk in the large attachment upload control, Huawei Network Disk (Dbank), Jinshan fast disk they are all using the control to achieve large file upload function. This is done primarily to reduce server stress (faster server response times and more concurrent processing), saving server memory (the server does not have to allocate the same size of memory to each user) while improving the user experience (users can upload oversized files in a complex network environment).

Of course, from a technical point of view, such as these internet-well-known enterprises are also considered to support the massive users of distributed file storage architecture design. Because their file storage servers cannot be one, they will dynamically increase as the number of users increases.

If it is true that some friends say that the flash control can solve the problem of large file upload, then Tencent will not spend so much effort to develop a control for the QQ mailbox specifically.

Does not use the control, as if it can only be implemented with Flash? The biggest problem with using PHP or using Flash for the continuation of a breakpoint is how to upload 1GB data to the Web server at once. Flash because of security problems in the processing performance of oversized files has a large problem.

Flash also belongs to the control category
It is easier to upload a breakpoint than to continue the download.

As long as the breakpoint continues to pass, that is the two sides of the matter, both ends to support the line

  • 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.