IsUpload = false IE

  1. #1

    IsUpload = false IE

    Hello.

    I have a problem when using IsUpload = false; in IE

    Failure in Chrome is working properly, but not in IE.

    When completing the method starts a download with the name of the method
    Click image for larger version. 

Name:	report.png 
Views:	106 
Size:	32.1 KB 
ID:	2863

                                                        <ext:Button ID="SaveButton" AnchorHorizontal="100%" runat="server" Text="Guardar" Icon="Disk" >
                                                            <DirectEvents>
                                                                <Click Url="/Data/SaveImage/" IsUpload="true" CleanRequest="true" Method="POST" 
                                                                    Success="#{imagen}.setImageUrl('/resources/images/'+result.extraParamsResponse.message +'.txt');"
                                    
                                                                    Failure="Ext.Msg.show({ 
                                                                        title   : 'Error', 
                                                                        msg     : 'File Not Compatible (Complatible:[jpeg,gif,png]).', 
                                                                        minWidth: 200, 
                                                                        modal   : true, 
                                                                        icon    : Ext.Msg.ERROR, 
                                                                        buttons : Ext.Msg.OK 
                                                                    });">
    
                                                                    <ExtraParams>
                                                                            <ext:Parameter Name="id" Value="getDealerID()" Mode="Raw" />
                                                                    </ExtraParams>
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>
            public AjaxResult SaveImage(string id)
            {
                
                AjaxResult response = new AjaxResult();
    
                try
                {
                  
                    HttpPostedFileBase file = Request.Files[0];
                    string ext = file.ContentType;
    
                    if (ext != "image/jpeg" && ext != "image/gif" && ext != "image/png" && ext != "image/pjpeg")
                    {
                        response.IsUpload = false;
                        return response;
                    }
    
                    string path = HttpContext.Request.MapPath("../../Resources/images/");
                    string filePath = Path.Combine(path,id);
    
                    file.SaveAs(filePath);
    
                    response.IsUpload = true;
                    response.ExtraParamsResponse["message"] = "OK";
                    return response;
                }
                catch
                {
                    response.IsUpload = false;
                    return response;
                }
    
            }
    Any Idea?

    thanks
  2. #2
    I also happens.
    Anyone know anything?

    thanks
  3. #3
    Why do you set IsUpload=false?
    It must be true if you upload a file
  4. #4
    I use isupload = false for example when the file is not compatible.
  5. #5
    It must be true in any way (if file was uploaded), otherwise response will be incorrect
  6. #6
    If I use IsUpload Failure I can not use because it assumes that everything is correct?
  7. #7
    It is not assume that everything all correct. It is indicator for AjaxResult to make response to compatible with upload request
    If upload is incorrect then you can return any variable in ExtraParamsResponse to indicate the problem
  8. #8
    Thank you very much for the explanation.

    A greeting.

Similar Threads

  1. DirectEventConfig IsUpload export to excel
    By zfreeman in forum 2.x Help
    Replies: 1
    Last Post: Aug 02, 2012, 2:56 PM
  2. [CLOSED] IsUpload in treepanel submit
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 10, 2011, 5:26 PM
  3. [CLOSED] IsUpload and EventMask
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 20, 2010, 12:03 PM
  4. Finish AjaxEvent with isUpload=true
    By Kaido in forum 1.x Help
    Replies: 0
    Last Post: Nov 09, 2010, 3:25 PM
  5. [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 06, 2010, 6:35 PM

Posting Permissions