方法一. from django.http import StreamingHttpResponse def big_file_download(request): # do something... def file_iterator(file_name, chunk_size=512): with open(file_name) as f: while True: c = f.read(chunk_size) if c: yield c else: break the_file_name =…
Public Sub downLoadFile(ByVal fPath As String) Dim fileInfo As System.IO.FileInfo = New System.IO.FileInfo(fPath) Response.Clear() Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(fileInfo.Name.ToStri…