Upload file: response Text returns undefined value in IE browser
Hello everybody,
At this moment, I am encountering an issue I have not found the way to solve yet. Please give me a clue if
you can. Many thanks in advance!
I am developing a module allowing users to upload image file to server with CodeIgniter and YUI. There
are some restrictions for this upload: image files only, .GIF, JPG, ... and the maximum capacity for the
uploaded file not exceed 1 Megabyte. And the following is my JS code:
function uploadPhoto()
{
setGlobalMessage("");
var sURL = _APBMRootURL + "adminMembers_controller/uploadPhoto";
var callback =
{
upload: handleUploadPhotoUpload,
failure: handleUploadPhotoFailure
};
var f = document.getElementById("frm_Main");
var postData = YAHOO.util.Connect.setForm(f, true);
var request = YAHOO.util.Connect.asyncRequest('POST', sURL, callback);
}
function handleUploadPhotoUpload(o)
{
//alert(o.reponseText);
if (o.responseText == undefined || o.responseText == null)
{
setGlobalMessage("Connection timeout. Please try again later.");
///setGlobalMessage("The size for the uploaded image should not exceed 1Mbs.");
return;
}
...
}
function handleUploadPhotoFailure(o)
{
.....
}
In IE, I got o.responseText with undefined value whenever I upload the file with the capacity larger than the
allowed maximum capacity as I mentioned above.
While I do not get this issue in Firefox.
Many thanks for your assistance!
Best Regards,
Nhat