Jun 14, 2011, 1:06 PM
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
thanks
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
<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