I have read bestcomy's new ideas on uploading large files in ASP. NET.

Source: Internet
Author: User

I saw bestcomy's series about uploading large files two days ago.ArticleI have benefited a lot. I have a new understanding of the methods for uploading files in ASP. NET, which is much better than the simple methods of using saveas. New ideas are coming as your understanding increases. I wonder if the aspnetupload component can support resumable data transfer. However, the process of uploading files on the server to the database can be resumed. The basic idea of uploading a large file to a database is to read the file to the buffer in multiple times and write the file in a specified block area using the updatetext function of SQL Server. My idea is to add a field in the database to indicate the number of uploaded bytes. If you re-upload the file, you can start the last upload and continue to upload the file.

The last processing process again:

1. Read the text pointer value of the image column. Select @ pointer = textptr (picture) from categories where categoryid = @ idx

2. The updatetext categories. Picture @ pointer @ offset @ Delete with log @ bytes function.

@ Pointer value obtained in step 1

@ Offset, block size

@ Delete: 0 indicates that data is not deleted.

@ Bytes data inserted this time

3. When reading file dataCodeDifferent. Want to know the number of bytes that have been uploaded last time (add a field to save ). Use BR. readbytes (number of uploaded bytes) to increase the current position of the stream to the start point of the file to be uploaded. Use BR. readbytes (buffer_length); to read the data to be inserted.

Because I do not know the code in the aspnetupload component, I do not know how bestcomy uploads large files to the server on the client. Is it still a multipart upload method. If the multipart upload method is used, can resumable upload be implemented by append in sequence.


related documents:
articles in bestcomyblog
(http://files.cnblogs.com/bestcomy/filetomssql.rarcontains the code for uploading files to the data warehouse)
"retain resources when writing blob values to SQL Server" is described in. net.

Related Article

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.