Discussion Locked

Tricks of the Web dev trade

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
What are your favorite tricks of the trade, as featured in this week's Web Development Zone newsletter? Will you utilize the tricks Phillip describes in the column?

4 replies

by hoyasaxa93

Interesting approach... However, ADO supports the binary read/write functionality you seek. This is a definite bonus when your web site's host will not install your custom DLL's.

by bblackmoor

"Or, you're sending an HTML-formatted e-mail"

Which is, of course, EVIL...

"and you want to provide a 'read receipt' for that e-mail"

Which is, again, EVIL...

Use your powers for GOOD! Eschew HTML mail! Eschew spyware!

by jamie

Why use a DLL? Here is a simple function I found somewhere that works fantastic for downloading files. Changing the content-type should work like the DLL. ~Jamie

function DownloadFile(strFilePath)
Dim varSplit, strFileName, objStream
varSplit=split(strFilePath, "\")
If ubound(varSplit) > -1 then
strFileName = varSplit(ubound(varSplit))
response.contenttype = "application/octet-stream"
response.addheader "content-disposition","attachment; filename=" & strFileName
response.cachecontrol = "public"
set objstream = createobject("adodb.stream")
objstream.open
objstream.type = 1
objstream.loadfromfile strFilePath
response.binarywrite objstream.read
objstream.close
set objstream = nothing
end if
end function

by bazmech

I managed to make this fail almost straight away simply by using a 90K image.
One modification for use is to change the line

Dim i As Integer
to
Dim i As Long

just before the 'While -- Wend' loop.

I like the idea of using ADO.
Also FSO should be worth a look into.

This discussion is closed to new replies.