ISAPI Rewrite of URL not being picked up after image upload

Last post 07-08-2010, 9:19 AM by debdba. 4 replies.
Sort Posts: Previous Next
  •  07-07-2010, 11:24 AM 62331

    ISAPI Rewrite of URL not being picked up after image upload

    The page we have the image uploader on usually has a URL of:
    http://localhost/BibleStudyTools/community/users/
    so it goes to the default.aspx page. After uploading an image, the URLchanges on its own to
    http://localhost/BibleStudyTools/community/users/default.aspx
    and works fine.  No problems.
     
    However, we can arrive at the same page another way and the URL shows as:
    http://localhost/BibleStudyTools/community/users/debbie/
    but thru an ISAPI rewrite rule, this REALLY is:
    http://localhost/BibleStudyTools/community/users/default.aspx?username=debbie
     
    After uploading an image, the URL changes on its own to
    http://localhost/BibleStudyTools/community/users/debbie/default.aspx
    and that page doesn't exist so we get an error.  Page Not Found.
     
    Any ideas how to get around this?
     
    THANKS for any ideas!!
  •  07-07-2010, 12:28 PM 62334 in reply to 62331

    Re: ISAPI Rewrite of URL not being picked up after image upload

    I tried to intercept the upload_completed event and just redirect to the
    http://localhost/BibleStudyTools/community/users/default.aspx
    page but haven't gotten that to work yet.  It's just sitting there doing nothing now.
  •  07-07-2010, 12:58 PM 62335 in reply to 62334

    Re: ISAPI Rewrite of URL not being picked up after image upload

    I guess to simplify the question, when the uploader starts, it's adding default.aspx to the URL and trying to refresh the page, which because of our URL rewriting rules, results in an invalid  URL.  Is there a  way to control the default.aspx being added?
    THANKS
  •  07-07-2010, 9:28 PM 62338 in reply to 62335

    Re: ISAPI Rewrite of URL not being picked up after image upload

    Hi debdba,
     
    Please try the example below
     
    1. <%@ Page Language="C#" Title="Customize the queue UI" %>   
    2.   
    3. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">   
    5.   
    6. <script runat="server">   
    7.   
    8.     protected void UploadAttachments1_FileUploaded(object sender, UploaderEventArgs args)   
    9.     {   
    10.         Page.Response.Redirect("http://localhost/uploader/default.aspx?name=ken");   
    11.         //Page.Response.Redirect("http://localhost/uploader/");   
    12.     }   
    13. </script>   
    14.   
    15. <html xmlns="http://www.w3.org/1999/xhtml">   
    16. <head id="Head1" runat="server">   
    17. </head>   
    18. <body>   
    19.     <form id="Form1" runat="server">   
    20.         <CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1" OnFileUploaded="UploadAttachments1_FileUploaded">   
    21.         </CuteWebUI:UploadAttachments>   
    22.     </form>   
    23. </body>   
    24. </html>  
    Regards,
     
    ken
  •  07-08-2010, 9:19 AM 62367 in reply to 62338

    Re: ISAPI Rewrite of URL not being picked up after image upload

    Thanks for the suggestion Ken.
     
    Unfortunately, that didn't work.  I stepped thru the code to see what was happening and it is trying to redirect to
    http://localhost/BibleStudyTools/community/users/debbie/default.aspx
     
    BEFORE the FileUploaded event.  I even put the redirect in several other of the Ajax Uploader events and put breakpoints on them just to see what was happening before it redirects itself, and it is happening before it gets to any of them.
     
    Here's the exact scenario:
    I click on the Upload button, it lets me select the image to upload and click on the Open button, then BEFORE the
    Uploader1_FileValidating event and the
    Uploader1_FileUploaded event and the
    Uploader1_UploadCompleted event
    it tacks on the default.aspx to the URL and tries to go there.
     
    I'm thinking that when it comes back from the file selection dialog is when it's happening, to get itself back from the dialog and it thinks it's going to the same page where it was before but it isn't.  Seems like that's a bug in the Uploader code.
     
View as RSS news feed in XML