<%
Function FileCopy(byVal source, byVal destination)
Dim objFSO, objToCopy, boolErr, strErrDesc
On Error Resume Next
Set objFSO = Server.CreateObject("
if instr( right( source, 4 ), "." ) then
Set objToCopy = objFSO.GetFile(source)
else
Set objToCopy = objFSO.GetFolder(source)
end if
objToCopy.Copy destination
if Err Then
boolErr = True
strErrDesc = Err.Description
end if
Set objToCopy = Nothing
Set objFSO = Nothing
On Error GoTo 0
if boolErr then Err.Raise 5104, "FileCopy Statement", strErrDesc
End Function
ServArqDOWN = "\\ServidorIIS\wwwroot\
ArquivoOrigem = "\\ServidorDeArquivos\pasta1\
cont = 1
letra = "."
While Left(Right(ArquivoOrigem, cont), 1) <> "\"
letra = Left(Right(ArquivoOrigem, cont), 1)
cont = cont + 1
Wend
sNomeArq = Right(ArquivoOrigem, cont - 1)
sNomeArqCompleto = ServArqDOWN & sNomeArq
FileCopy ArquivoOrigem, sNomeArqCompleto
Response.Write("<a href=""Transf/" & sNomeArq & Chr(34) & ">Clique Aqui para fazer download do Arquivo</a>")
%>