URL Rerwriting + ASP.NET Image Gallery ajax upload not working

115 Views Asked by At

I have a CMS that uses HeliconApe to rewrite requests with the following rule

RewriteRule ^/(.*)$ /custompage.aspx?pagename=$1 [NC,L,QSA]

I am also using an image gallery (https://cutesoft.net/ASP.NET+Image+Gallery/) to provide a simple, easy to use image gallery in a CMS and I am having trouble getting the galleries upload to work with Apes URL Rewriting.

When a user requests a page, for example /contact-us.aspx, they are served /custompage.aspx?pagename=contact-us.aspx and /custompage.aspx generates the content, sets the form action to /contact-us.aspx, and adds the gallery with ContentArea.Controls.Add(Page.LoadControl(New DotNetGallery.GalleryBrowser))

When I try to upload a file, for example logo.png, with the ASP.NET Image Galleries built in uploader I see 3 notices in the console

First there is a post to

/contact-us.aspx?UseUploadModule=Dynamic&_Namespace=DotNetGallery&_UploadID=ctl00_ContentPlaceHolder1_ctl02_UploaderImage_1436363874058_1&_UploadControlID=ctl00$ContentPlaceHolder1$ctl02$Uploader&ContextValue=!3wEWAQU1QzpcVXNlcnNcdHdpbGJlcnRcQXBwRGF0YVxMb2NhbFxUZW1wXEFqYXhVcGxvYWRlclRlbXDTV65TuH6b!1qTC8Eov!1tLoCrIFSZy43V46b1KWs!1urZg!2!2&_VFN=logo.png&_Addon=upload&_AddonGuid=d6cd8556-af6f-3785-743f-257780b216b8

If I follow the link I see a file with the following contents but I think that is because I am viewing it without posting my own data (which I dont know how to do?)

<script type='text/javascript'>if(window.parent.CurrentUpload)window.parent.CurrentUpload.UploadError('ctl00_ContentPlaceHolder1_ctl02_UploaderImage_1436361349705_1','Unable to find the uploaded file from StreamManager(sm==null).','')</script>

Then a post to

/contact-us.aspx?UseUploadModule=Dynamic&_Namespace=DotNetGallery&_UploadID=ctl00_ContentPlaceHolder1_ctl02_UploaderImage_1436363874058_1&_UploadControlID=ctl00$ContentPlaceHolder1$ctl02$Uploader&ContextValue=!3wEWAQU1QzpcVXNlcnNcdHdpbGJlcnRcQXBwRGF0YVxMb2NhbFxUZW1wXEFqYXhVcGxvYWRlclRlbXDTV65TuH6b!1qTC8Eov!1tLoCrIFSZy43V46b1KWs!1urZg!2!2&_VFN=logo.png&_Addon=verify&_AddonGuid=d6cd8556-af6f-3785-743f-257780b216b8

Which fails with a 404 and alerts http error1 :404:Not Found

If I change the form action to /custompage.aspx?pagename=contact-us.aspx then the upload works.

I have tried contacting the galleries developers but they have never responded and the live chat isn't very helpful.

So I guess my questions are what might be causing this issue, is there any way to debug proprietary controls contained in dlls, and is there some setting or code I might be missing to make everything play together nicely?

Thanks!

0

There are 0 best solutions below