Currently, users can download mp3 files from my website PROVIDED the files are relatively small. With large files (4 mega), the files do not download. I understand 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 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 "Sorry, your file is not yet prepared or else you entered the wrong name and number codes.</b></font>"
End If
%>
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 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 "Sorry, your file is not yet prepared or else you entered the wrong name and number codes.</b></font>"
End If
%>