Click here to Skip to main content
15,508,758 members

Comments by omgade (Top 4 by date)

omgade 3-Apr-15 4:06am View    
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' >
<head>
<title>AJAX Upload Progress & Cancel Upload</title>
<script type='text/javascript'>
var file;
function prepareUpload()
{
document.getElementById('fileSize').innerHTML = '';
document.getElementById('bytesUploaded').innerHTML = '';
document.getElementById('percentUploaded').innerHTML = '';
document.getElementById('uploadProgressBar').style.width = '0%';

// get file name
file = document.getElementById('file').value;
if(file.lastIndexOf('\\')>=0)
file = file.substr(file.lastIndexOf('\\')+1);
document.getElementById('fileName').innerHTML = file;

// get folder path
var curFolder = window.location.href;
if(curFolder[curFolder.length-1]!='/')
curFolder = curFolder.substring(0, curFolder.lastIndexOf('/')+1);

document.getElementById('target').innerHTML = curFolder;
document.getElementById('frm').action = curFolder;
}

var timerId;
function formSubmit()
{
timerId = setInterval('updateProgress()', 1000);
document.getElementById('cancelUploadBtn').disabled = false;
}

function updateProgress()
{
var request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
var uploadTarget = document.getElementById("frm").action + file;


request.open("REPORT", uploadTarget, true);
request.send("<upload-progress xmlns="ithit">");
var resp = request.responseText;

// Extract number of bytes uploaded and total content length of the file.
// Usually you will use XML DOM or regular expressions for this purposes
// but here for the sake of simplicity we will just extract using string methods.
var size;
var sizeIndex = resp.indexOf("total-content-length");
if(sizeIndex != -1)
{
size = resp.substring(resp.indexOf(">", sizeIndex)+1, resp.indexOf("", bytesIndex)+1, resp.indexOf("</iframe>";
clearInterval(timerId);
document.getElementById("cancelUploadBtn").disabled = true;
}
</script>
</head>
<body>
<span id="uploadFrameHolder" style="display:none"><iframe name="uploadFrame" ></iframe></span>

<form id="frm" method="POST" enctype="multipart/form-data" action="/" target="uploadFrame" >
<input type="file" id="file" name="dummyname" /
omgade 19-Mar-15 7:40am View    
But developer express provide application style
omgade 9-May-13 0:53am View    
Not need posting code, you just take button on windows form & run that project-> then open task manager->go to process-> go on your application .vshost.exe ->check application Memory (Private working set)->then click on windows form button-> again check private working set memory(this process done more times)private working set memory will be continuous increase.My application fetch large data from sever as well as application can not close long time(month/year).
omgade 22-Apr-13 8:54am View    
behind that button is large process.when i click in button more times then software throw error
is"Out Of Memory Exception"its very critical because my application is use 24X7 hours without closing.