1. Faça o download do seguinte arquivo de texto e altere .txt para remote.asp, existem métodos de configurações específicos.
A cópia do código é a seguinte:
<%
'Se deve salvar imagens remotas ao adicionar recursos
ConstSSaveFileSelect = true
'Imagem remota Salvar diretório, não adicione "/" no final
ConstSsaveFilePath = "/Images/News"
'Tipo de economia de imagem remota
ConstSFileExt = "Jpg | gif | bmp | png"
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////S
'Função: substitua o arquivo remoto na string como um arquivo local e salve o arquivo remoto
'parâmetro:
'shtml: string para substituir
'SsavePath: o caminho para salvar o arquivo
'Sext: Executar extensão de substituição
FunctionReplaceremoteurl (shtml, ssaveFilePath, sfileExt)
Dims_content
s_content = shtml
IfisObjInstalled ("Microsoft.xmlHttp") = falsethen
ReplaceRemoteurl = s_content
Saída de saída
Endif
Dimre, RemoteFile, RemoteFileurl, SaveFileName, SaveFileType, ArSaveFileNames, ARRSAVEFILENAME, SSAVEFILEPATHS
Setre = newRegexp
re.IGNORECASE = true
re.global = true
re.pattern = "((http | https | ftp | rtsp | mms): (///////) {1} ((/w)+[.]) {1,} (n et | com | cn | org | cc | tv | [0-9] {1,3}) (/s*//) ((/s)+[.] {1} ("& sfileExt &"))) "
Setremotefile = re.execute (s_content)
ForeachRemoteFileUrlinRemoteFile
SaveFileType = substituir (substituir (remotefileurl, "/", "a"), ":", "a")
ArrSaveFilename = Right (SaveFileType, 12)
ssaveFilePaths = ssaveFilePath & "/"
SaveFilename = ssaveFilePaths & arSaveFileName
CallsAveRemoteFile (SalveFilename, RemoteFileurl)
S_COntent = Substitua (S_Content, RemoteFileurl, SaveFileName)
Próximo
ReplaceRemoteurl = s_content
Função final
'/////////////////////////////////////////////////////////////////////////////////////////
'Função: salve arquivos remotos no local
'Parâmetro: LocalFilename ------ Nome do arquivo local