I made this little program to be down load files using http. I want to be able to down load any kind of file from *.txt to *.mp3. I can down load smaller files, but on something like a 5 min mp3 it crashes. I think this is because the program is using all the computer memory. I need to the code to use the hard drive like memory. Some one explained that that was what I have to do. But didn't know the code. If you know how to fix this plz post it.
Thx!

Note: txt = textbox bnt = button mnu = menu

code:

'Declares everything
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
'this downloads
Public Function DownloadFile(URL As String, _
LocalFilename As String) As Boolean

Dim lngRetVal As Long

lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)

If lngRetVal = 0 Then DownloadFile = True

End Function

Private Sub bntdl_Click()
'enter txt for site name
MsgBox DownloadFile(txtdl.Text, txtto.Text)
End Sub

Private Sub bntlocation_Click()
'to lazy to put the code in agien
mnudl_Click
End Sub

Private Sub bntsave_Click()
'where to save to
cdsave.ShowSave
txtto.Text = cdsave.FileName
End Sub

Private Sub Form_Unload(Cancel As Integer)
Select Case MsgBox("Are you sure you want to quit?", vbYesNo)
Case vbYes
Unload Me
End
Case vbNo

End Select
End Sub

Private Sub mnudl_Click()
'where to dl from
txtdl.Text = InputBox("Enter URL")
End Sub

Private Sub mnudlfile_Click()
'where to save
bntsave_Click
End Sub

Private Sub mnuquit_Click()
'quiting
Select Case MsgBox("Are you sure you want to quit?", vbYesNo)
Case vbYes
Unload Me
End
Case vbNo

End Select
End Sub

Private Sub mnuweb_Click()
bntdl_Click
End Sub