Currently, users can download mps files from my website PROVIDED the files are relatively small. With large files (4 mega), the files do not download. I undestand that large files must be downloaded in blocks. How does one do this??
My current code reads as follows:
<%
Set filesys = CreateObject("Scripting.FileSystemObject")
strWav = "/media/"&Request.Form("code1")&Request.Form("code2")&Request.Form("code3")&".mp3"
strFilename = server.MapPath(strWav)
if request.form("code1") = "" OR len(request.form("code1")) <5 OR request.form("code2") = "" OR len(request.form("code2")) <4 OR request.form("code3") = "ER" Then
response.write "<b><p align = center> <font color=" & "#FF0000" & ">Please enter all required fields. Be sure to enter the correct number of digits.</b></font>"
else
If filesys.FileExists(strFilename) Then
strFilename = server.MapPath(strWav)
Response.Buffer = True
Response.Clear
Set s = Server.CreateObject("ADODB.Stream")
s.Open
s.Type = 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(strFilename)
intFilelength = f.size
s.LoadFromFile(strFilename)
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.Charset = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite s.Read
Response.Flush
s.Close
Set s = Nothing
Else
response.write "<b><p align = center><font color=" & "#FF0000" & ">Sorry, your file is not yet prepared or else you entered the wrong name and number codes.</b></font>"
End If
End If
%>