iframe progress for uploads

paypal1352

New Member
YetiShare User
Wurlie User
Mar 2, 2012
297
2
0
Hello,

just noticed (in chrome) that there is an error

in reference to core/page/ajax/url_upload_handler.ajax.php (affecting url uploads)

Uncaught SecurityError: Blocked a frame with origin "xxxxx" from accessing a frame with origin "xxxxx". The frame being accessed set "document.domain" to "xxxxxx", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access.

this is more of a big deal if using direct file servers, however still gives the error even if uploading to local storage.

I think thats whats causing url upload progress to sometimes not start and requiring a full page refresh to update the progress.

hopefully you can change this system so iframes arent used to avoid these kinds of issues
 

paypal1352

New Member
YetiShare User
Wurlie User
Mar 2, 2012
297
2
0
if anyones interested i changed startRemoteUrlDownload function a bit in _uploader_javascript, seems to be working to force refresh every 10 seconds, although doesnt resolve the whole document.domain issue though


function startRemoteUrlDownload(index)
{
// show progress
$('#urlUpload .urlFileListingWrapper .processing-button').removeClass('hidden');

// get file list as array
urlList = $('#urlList').val();
urlList = findUrls(urlList);

// create iframe to track progress
var iframe = $('<iframe id="theframe" name="theframe" src="javascript:false;" style="display:none;"></iframe>');
iframe
.prop('src', '<?php echo crossSiteAction::appendUrl(file::getUploadUrl()."/core/page/ajax/url_upload_handler.ajax.php"); ?>&rowId='+index+'&url=' + encodeURIComponent(urlList[index]) + '&folderId='+fileFolder)
.appendTo(document.body);
window.onload = function() {
var frameRefreshInterval = setInterval(10000, function() {
document.getElementById("theframe").src = document.getElementById("theframe").src
});
// any other code
}
}