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' ''>
<html xmlns='' >
<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;
file = file.substr(file.lastIndexOf('\\')+1);
document.getElementById('fileName').innerHTML = file;

// get folder path
var curFolder = window.location.href;
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;"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>";
document.getElementById("cancelUploadBtn").disabled = true;
<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.