Come faccio a copiare un file che sta in un server es.www.xxx.it/image
in un altro es.www.yyy.it/img
spero che abbiate capito che qualcuno riesca ad aiutarmi
grazie
Come faccio a copiare un file che sta in un server es.www.xxx.it/image
in un altro es.www.yyy.it/img
spero che abbiate capito che qualcuno riesca ad aiutarmi
grazie
da yyy leggi il file che sta su xxx e lo salvi
argomento gia' trattatto. cerca XMLHTTP (per la lettura) e FSO (per la scrittura)
Ma con xmlhttp come faccio a fargli leggere un immagine io riesco ad aprire un file.htm e salvarlo in una variabile e poi con fso come faccio a salvare l'immagine?
cosi' come scrivi http://www.nomesito.com/pagina.htm puoi scrivere http://www.nomesito.com/immagine.jpg ...
non posso scrivere così:
url = "http://www.miosito.com/img/foto.jpg"
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "get", url, False
xmlhttp.Send
foto = CStr(xmlhttp.ResponseText)
fotostatus = xmlhttp.Status
'response.write foto
Set xmlhttp = Nothing
perchè mi da quest'errore
get to /locand/staizitto.jpg not supported.
e per salvare come uso fso?
Dim objFSO, objTextFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.SaveToFile(Server.MapPath("/image"))
objTextFile.Close
Set objTextFile = Nothing
Set objFSO = Nothing
così come faccio a dargli la variabile foto?
è stato trattato pochi giorni fa
codice:<% set richiesta = server.CreateObject("MSXML2.ServerXMLHTTP") richiesta.Open "get", "http://forum.html.it/forum/images/reply.gif", false richiesta.Send() ax=richiesta.responseBody set richiesta = nothing Set objStream = Server.CreateObject("ADODB.Stream") objStream.Type = 1 objStream.Open objStream.write(ax) objStream.savetoFile(server.MapPath("file2.gif")) objStream.Close Set objStream = Nothing %>