Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Upload file: response Text returns undefined value in IE browser   Topic List   < Prev Topic  |  Next Topic >
Reply | Forward  |  Next Message > 
Re: Upload file: response Text returns undefined value in IE browser

Hi,

A couple of points: I'm not sure if they'll help with the immediate problem,
though!

1. I don't think the upload case ever calls a failure handler - they all go to
upload (check http://developer.yahoo.com/yui/connection/#upload)
2. It's not clear if you're using an SSL connection, but if so you'll need the
third argument in setForm set to true:
var postData = YAHOO.util.Connect.setForm(f, true, true);
3. test for undefined using ===, rather than ==
4. o.responseText should be what's in the iframe that's used for the upload (see
the docs linked above), but I'm not sure of the detail of this. Is the filesize
enforcement at the form or server? That may affect things. What does your
server return if the file is too big?

Hope that's helpful, but may not be!

Matt

--- In ydn-javascript@yahoogroups.com, false <htnhat@...> wrote:
>
> 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
>





Sat Nov 7, 2009 11:35 am

mattatlamplight
Offline Offline
Send Email Send Email

Forward
 |  Next Message > 
Expand Messages Author Sort by Date

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...
false
htnhat
Offline Send Email
Nov 7, 2009
9:44 am

Hi, A couple of points: I'm not sure if they'll help with the immediate problem, though! 1. I don't think the upload case ever calls a failure handler - they...
Matt
mattatlamplight
Offline Send Email
Nov 7, 2009
11:36 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help