Re: ERROR WHEN CULTURE IS SET TO ar-SA

  •  01-17-2011, 8:26 PM

    Re: ERROR WHEN CULTURE IS SET TO ar-SA

    Hi hassan,
     
    This issue only happen on the trial license. Please change the CurrentCulture to "en-Us" before method below(red code) and than change back to "ar-SA" after it.
     
    CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);
     
     
    Below is the new code of Sample1
     
    1. public ActionResult Sample1(string myuploader)  
    2.         {  
    3.             using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))  
    4.             {  
    5.                 uploader.UploadUrl = Response.ApplyAppPathModifier("~/UploadHandler.ashx");  
    6.                 //the data of the uploader will render as <input type='hidden' name='myuploader'>   
    7.                 uploader.Name = "myuploader";  
    8.                 uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp,*.zip,*.rar";  
    9.   
    10.                 uploader.InsertText = "Select a file to upload";  
    11.   
    12.                 //prepair html code for the view  
    13.                 ViewData["uploaderhtml"] = uploader.Render();  
    14.   
    15.                 //if it's HTTP POST:  
    16.                 System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-Us");  
    17.                 if (!string.IsNullOrEmpty(myuploader))  
    18.                 {  
    19.                     //for single file , the value is guid string  
    20.                     Guid fileguid = new Guid(myuploader);  
    21.                   
    22.                     CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);  
    23.                     if (file != null)  
    24.                     {  
    25.                         //you should validate it here:  
    26.   
    27.                         //now the file is in temporary directory, you need move it to target location  
    28.                         //file.MoveTo("~/myfolder/" + file.FileName);  
    29.   
    30.                         //set the output message  
    31.                         ViewData["UploadedMessage"] = "The file " + file.FileName + " has been processed.";  
    32.                     }  
    33.                 }  
    34.                 System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("ar-SA");  
    35.   
    36.             }  
    37.   
    38.             return View();  
    39.         } 
     Regards,
     
    Ken
View Complete Thread