Ajax Uploader in MVC deletres ALL pages from History

Last post 05-11-2010, 5:19 AM by hassan. 6 replies.
Sort Posts: Previous Next
  •  05-06-2010, 3:09 PM 60781

    Ajax Uploader in MVC deletres ALL pages from History

    Can someone help us. We dont know if we are doing something wrong or is this a bug with the Uploader. We tried the following in the sample MVC app download.
    Jist add a couple of dummy views and a couple of links to those views. Now use a smaple page with the uploader on iot such as Sample1. Upload a couple of files and then use the links to go to the other dummy pages without the uploader. If you now use the browser back button and go back to the page with the uploader on it and wait a few seconds, the browser forward button becomes diabled and the pages which you viewed cannot be got at! whichever direction you navigate using the browser buttons.
     
    Is this a bug or are we missing something
    Many thanks.
  •  05-06-2010, 9:24 PM 60787 in reply to 60781

    Re: Ajax Uploader in MVC deletres ALL pages from History

    Hi,
     
    I can confirmed that issue.
     
    That is a bug when the page use IFrame.
     
    We will fix it
     
    Regards,
    Terry
     
  •  05-06-2010, 9:51 PM 60789 in reply to 60787

    Re: Ajax Uploader in MVC deletres ALL pages from History

    Thanks. Would appreciate an email when fixed. or should we just keep an eye on this Post? Any idea on Timescale?
     
    While you are fixing this, 2 other problems which we have come across are:
     
    1- In an MVC application, the form values are not presisted when a postback occurs with the uploader. I don't know if it has to do with the bug
     
    2- If you set the InsertButtonID to an Image, when using Firefix and you refresh the page, the normal file uploader (i.e. a Browse button) suddenly appears. This does not happen in IE.
     
    Thanks again.
  •  05-10-2010, 10:08 PM 60888 in reply to 60789

    Re: Ajax Uploader in MVC deletres ALL pages from History

    Hi,
     
    This issue is fixed. please download it again.
     
    Our example have one page which tell you how to persist a collection for the temp files. but if move the temp file to your folder , the GetUploadedFile will return null for the GUID. So you need maintain the moved list by yourself.
     
    Can you reproduct the image button in this page ? http://ajaxuploader.com/demo/simple-upload-UI.aspx 
    Regards,
    Terry
  •  05-11-2010, 12:03 AM 60890 in reply to 60789

    Re: Ajax Uploader in MVC deletres ALL pages from History

    Hi,
     
    We have fixed the firefox issue. Please download the last version.
     
    Regards,
    Terry
  •  05-11-2010, 5:04 AM 60900 in reply to 60890

    Re: Ajax Uploader in MVC deletres ALL pages from History

    Hi Terry,
     
    Fantastic - Well Done - The IE issue with the pages is fixed. But I am still getting the browse buttons in FireFox. The link you have sent me works great in FireFox. Why does it do that in MINE? Which example in the download should I look at and how have you made your page work correctly in Firefox?
     
    Another point you may like to consider is that the demo page seems to be in a normal asp.net website and not an MVC app. We tested it in a normal asp.net website and the FireFox Issue works perfectly even with the old Uploader.
     
    I have also listed below that we have more than 1 uploader on the page and the way we are adding them.
     
    Many thanks
  •  05-11-2010, 5:19 AM 60902 in reply to 60900

    Re: Ajax Uploader in MVC deletres ALL pages from History

    We also tried it in FireFox with 1 image (i.e. 1 uploader) and it seems to work. But when you put a few uploaders on the page, that seems to be the problem.
     
    The way we are putting several (infact 10) uploaders on the page is
     
    First Uploader

    using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))

    {

    uploader.UploadUrl = Response.ApplyAppPathModifier("~/UploadHandler.ashx");

    //the data of the uploader will render as <input type='hidden' name='myuploader'>

    uploader.FormName = "uploader1";

    uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp";

    uploader.InsertButtonID = "image1";

    //uploader.UploadType = CuteWebUI.UploadType.Flash;

    //prepair html code for the view

    ViewData["uploaderhtml1"] = uploader.Render();

    //if it's HTTP POST:

    if (!string.IsNullOrEmpty(uploadervalue) && uploaderid == "uploader1")

    {

    //for single file , the value is guid string

    Guid fileguid = new Guid(uploadervalue);

    CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);

    if (file != null)

    {

    //you should validate it here:

    //now the file is in temporary directory, you need move it to target location

    //file.CopyTo("~/TempDir/" + file.FileName);

    //ResizeImage(file, uploaderid);

    //set the output message

    ViewData["UploadedMessage"] = "The file " + file.FileName + " has been processed.";

    }

    }

    }

    //

     
    Second Uploader and so on

     

    using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))

    {

    uploader.UploadUrl = Response.ApplyAppPathModifier("~/UploadHandler.ashx");

    //the data of the uploader will render as <input type='hidden' name='myuploader'>

    uploader.FormName = "uploader2";

    uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp";

    uploader.InsertButtonID = "image2";

    //uploader.UploadType = CuteWebUI.UploadType.Flash;

    //prepair html code for the view

    ViewData["uploaderhtml2"] = uploader.Render();

    //if it's HTTP POST:

    if (!string.IsNullOrEmpty(uploadervalue) && uploaderid == "uploader2")

    {

    //for single file , the value is guid string

    Guid fileguid = new Guid(uploadervalue);

    CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);

    if (file != null)

    {

    //you should validate it here:

    //now the file is in temporary directory, you need move it to target location

    //file.CopyTo("~/TempDir/" + file.FileName);

    //ResizeImage(file, uploaderid);

    //set the output message

    ViewData["UploadedMessage"] = "The file " + file.FileName + " has been processed.";

    }

    }

    }

View as RSS news feed in XML