Big file upload talk, and problems encountered

xiaoxiao2021-03-06  95

Recently doing a project, involving issues uploaded by documents. I have been uploaded before. But all are small files, no more than 2m. This time I demanded something above 1G. There is no way to find the information. WEB-based file uploading can use FTP and HTTP protocols, although the transfer is stable, but security is a serious problem, so it is not considered. There is only HTTP left. There are 3 ways in HTTP, PUT, WebDAV, RFC1867, the top 2 methods is not suitable for big file upload, and not said here.

It is determined that the popular upload assembly is started after using the RFC1867 format processing. After seeing N multi-code, there is discovered that there is currently no component program and some COM components are used using the Request.BinaryRead method. The uploaded data is obtained in one time, then analyze the processing. This is why the big file is very slow, IIS timeout does not say, even if the 1G file is up, the analysis has also gone. After that, I put the attention on foreign business components, more popular with Power-Web, AspUpload, ActiveFile, Abcupload, Aspsmartupload, SA-fileup. Among them, the relatively excellent is aspupload and sa-file, they know that the 2G file (SA-File E version does not even have a limit of file size), and the efficiency is also very good, how many efficiency of programming language is? (Mine The programming environment is VB6) to check some information, I think they are directly operating the file stream. This is not restricted by the size of the file. It's a good way.

But the foreigners are not absolutely perfect, and after the AspupLoad handles large files, the memory occupation is amazing. 1G is very generous. I used version 3.0.0.3. As for SA-FILE, although it is good, it is difficult to find (depressed ..) Disappointment, find 2 upload assemblies, lion.web.uploadModule and ASPNEB.UPloadModule and ASPNETUPLOAD are .NET, estimate is also an operational file stream. But upload speed and CPU usage are not as good as foreigated business components.

Made a test, the LAN passed the 1G file. The ASPUPLOAD upload speed is 4.4m / s, the CPU takes up 10-15, and the memory occupies 700m. SA-File is also almost like this. ASPNETUPLOAD is only 1.5m / s, and the average is 700k / s, the CPU takes up 15-39, the test environment: PIII800, 256M memory, 100M LAN. I think the ASPNETUPLOAD is slow to write the hard drive because of the reception file. The cost of resource occupation is to reduce the transmission speed. But you have to admire foreigners, the CPU occupies such a low ..... The two .NET components are also passed by PASS.

Take a slightly 2 questions is the upload progress and breakpoint resume. The display is relatively simple, mainly to query the status uploaded by the user, displayed in the browser with Script, as for the unfashionable display, you have to see the skills of scripting language. After breakpoint, HTTP mode is unable, because the browser starts from the beginning, no RANGE tag. The implementation method can only use ActiveX.

After the study, I decided to write a CGI to process the file upload. This will not take IIS to prevent the program error to affect the website access. The younger brother can only be done with VB6. After completion, it is found that WIN CGI is not bad. The indexer writes a File Server, which is dedicated to the upload of the file. But now I have two problems.

First, the text received by the Winsock control has garbled to be the error when the program is converted or the Winsock itself, the SO changed the Winsock Tool, the situation, the situation, there is not so much ......... Prepare VB.NET, directly operate Socket, the program has not been done, don't know if it is received with .NET will not garble. There is another cry.

Second, this problem is compared to the primary .... The received file stream cannot be restored to the file .. Cold, the end is how to efficiently handle the file stream, I want to think that there is only 2 ways, one is put it In the memory, then processed together, the second is to receive a file while receiving. But these two methods are not interesting

转载请注明原文地址:https://www.9cbs.com/read-122649.html

New Post(0)