Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/12/2005, 15:14
Avatar de mixgo7
mixgo7
 
Fecha de Ingreso: noviembre-2005
Mensajes: 23
Antigüedad: 18 años, 6 meses
Puntos: 0
Exclamación upload_ajax_archivos_

holas amigos estoy tratando de aser un upload de fotos con ajax pero no se en q estoy fayando pes les pego aka el code del envio



function Ajax() {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {

try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp
}




function Upload(id){
_mensajes = document.getElementById('mensajes');
_target = document.getElementById('objetivo');
_file = document.getElementById('file').value;


_ajax=Ajax()
_URL_="pag_asp/upload.asp";

_ajax.open("Post",_URL_,true);
_ajax.onreadystatechange=function() {

if (_ajax.readyState==1)
{
_mensajes.style.display = ''
_mensajes.innerHTML = "<strong class=text><em>Subiendo foto</em></strong>";
}
else if(_ajax.readyState==4)
{
if(_ajax.status==404) {
_mensajes.innerHTML = "<strong class=text><em>Error cargando la página contáctese con el administrador de la pagina Web ...</em></strong>"
}

}
}
_ajax.setRequestHeader('Content-Type','multipart/form-data');
_ajax.send('file=' + _file+'d=');


}





y el que recibe es upload.asp


<%
Set Upload = Server.CreateObject("Persits.Upload")
Count = Upload.Save("c:\upload")


Response.Write Count & " file(s) uploaded to c:\upload"

%>






lo malo es que no ase nada .pes q pedo asher plis