Fixed issue with file uploader not working in IE

Fixed issue with folder browser response getting cached
This commit is contained in:
Matt@MBP13-PC
2012-08-22 07:03:50 -01:00
parent f5d258b42d
commit 7b4bf6e502
4 changed files with 24 additions and 9 deletions

View File

@@ -350,19 +350,30 @@
var data = $item.data('data');
self._startDummyProgress(data);
$form.submit();
$iframe.load(function ()
{
// Read content returned
var response = $(this).contents().find('body').html();
//TODO: Check the response
// Stop dummy progress
//TODO: Set success flag based upon response?
self._stopDummyProgress(data, true);
// Read content returned
var rawResponse;
if (this.contentDocument) {
rawResponse = this.contentDocument.body.innerHTML;
} else {
rawResponse = this.contentWindow.document.body.innerHTML;
}
var response = $.parseJSON(rawResponse);
if(response.success) {
data.status = 'success';
} else {
data.status = 'error';
data.message = 'An error occured whilst uploading.';
}
self.opts.onDone(data);

View File

@@ -41,6 +41,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
{
var self = this;
$.ajaxSetup({ cache: false });
$.getJSON(self._opts.basePath + "/FolderBrowserService/GetChildren/" + self._parentId, function (data) {
if (data != undefined && data.length > 0) {
ko.mapping.fromJS(data, itemMappingOptions, self._viewModel.items);

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Script.Serialization;
using Umbraco.Core;
using Umbraco.Web.Media.ThumbnailProviders;

View File

@@ -75,10 +75,12 @@ namespace umbraco.presentation.umbracobase
int indexOfBase = url.ToLower().IndexOf(basedir);
url = url.Substring(indexOfBase);
if (url.ToLower().Contains(".aspx"))
url = url.Substring(0, url.IndexOf(".aspx"));
if (url.ToLower().Contains("?"))
url = url.Substring(0, url.IndexOf("?"));
object[] urlArray = url.Split('/');
//There has to be minimum 4 parts in the url for this to work... /base/library/method/[parameter].aspx