M
magix8
Hi,
anyone have experience on implement aspSmartUpload with Ajax ?
as aspSmartUpload required ENCTYPE="multipart/form-data"in FORM, how
can we achieve this in Ajax?
Basically, I have a <input type="file" id="myfile">, after user browse
the file and I will sendRequest via Ajax (using GET method), so that
the filepath is send to nextpage.asp for upload.
var http = getXMLHTTPRequest();
function sendRequest(t, f)
{
var myurl = 'nextpage.asp?filepath=' +
document.getElementById("myfile").value + '&f=' + f + '&t=';
myRand = parseInt(Math.random()*999999999999999);
var modurl = myurl + t + "&rand=" + myRand;
http.open("GET", modurl, true);
http.onreadystatechange = handleResponse;
http.send(null);
}
Does this make senses ?
in nextpage.asp, we called for request.querystring("filepath") ?
But how should the ENCTYPE="multipart/form-data" being included in
this case? or is there others ?
any thoughts?
Thank you very much.
cheers,
Magix
anyone have experience on implement aspSmartUpload with Ajax ?
as aspSmartUpload required ENCTYPE="multipart/form-data"in FORM, how
can we achieve this in Ajax?
Basically, I have a <input type="file" id="myfile">, after user browse
the file and I will sendRequest via Ajax (using GET method), so that
the filepath is send to nextpage.asp for upload.
var http = getXMLHTTPRequest();
function sendRequest(t, f)
{
var myurl = 'nextpage.asp?filepath=' +
document.getElementById("myfile").value + '&f=' + f + '&t=';
myRand = parseInt(Math.random()*999999999999999);
var modurl = myurl + t + "&rand=" + myRand;
http.open("GET", modurl, true);
http.onreadystatechange = handleResponse;
http.send(null);
}
Does this make senses ?
in nextpage.asp, we called for request.querystring("filepath") ?
But how should the ENCTYPE="multipart/form-data" being included in
this case? or is there others ?
any thoughts?
Thank you very much.
cheers,
Magix