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.