Hello Borg
Thanks a lot buddy
it works fine on your site
But I could not run it
I save above code in a file and changed files and locations
this is my code
=====
<%
'Open FSO Object
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")
'Set the stream object
Set objADOStream = server.createobject("ADODB.Stream")
'Open the streem oject
objADOStream.Open
'Set the stream object type to binary
objADOStream.Type = 1
'For ASP file
objADOStream.LoadFromFile Server.MapPath("uploads/myfile.asp")
'Get the file length
Set fileObject = fsoObject.GetFile (Server.MapPath("uploads/myfile.asp"))
intFileLength = fileObject.size
'Char set
Response.CharSet = "UTF-8"
'Set the right response content type for zip file
Response.ContentType = "application/octet-stream"
'Set the name of the file to download
Response.AddHeader "Content-disposition", "attachment; filename=005.zip"
'File size
Response.AddHeader "Content-Length", intFileLength
'Send zip to browser
Do Until objADOStream.EOS
'Make sure browser is connected
If Response.IsClientConnected Then
'Write the ado stream in small scable chunks
Response.BinaryWrite objADOStream.Read(100000)
'If buffer is done empty
If Response.Buffer Then
&a mp;a mp;n bsp; Response.Flush
End If
Else
&nbs p; Exit Do
End If
Loop
'Clean up
Set fsoObject = Nothing
Set fileObject = Nothing
objADOStream.Close
Set objADOStream=Nothing
%>
=====
I renamed my file to myfile.asp in uploads folder and in Response.AddHeader line I renamed it to 005.zip
when I ran above code I get this error
===
Microsoft VBScript compilation error '800a0400'
Expected statement
downloader.asp, line 50
&a mp;a mp;n bsp; Response.Flush
^
===
I removed this codes
&a mp;a mp;n bsp;
and ran it again but now I just can see chunks unreadable codes in entire of my page
How can I use your code
Like your site for my files
Thanks a lot