...

View Full Version : How to close .pdf in html iframe ?



Jian0203
05-22-2012, 08:47 AM
I have a html where the user will just need to keyin the .pdf value and it will retrieve the file and it will be copied to local drive for certain reason. Once it's copied to local file, it will be display in IE. After the user has finished reading the .pdf, the user will click on one button to reload the html.

Now I want to add in a delete function to delete the local saved .pdf. When I try to call the function after my "window.location.reload()" , the delete function will definitely not running.

So, is it possible to close the .pdf file with javascript first, then delete the local saved .pdf, then here we reload the html ?

Thanks for suggestion.
Note : The .pdf will be display in the same window and same tab of IE. Whole html will be running in only one tab and window.


function reloadPage()
{
window.location.reload()
remove();

}

function remove()
{
var sBnr = document.getElementById("txtBnr").value;
var myObject;
var fso = myObject = new ActiveXObject("Scripting.FileSystemObject");
fso.DeleteFile("C:\\eBondingDiagram\\" + sBnr + ".pdf");
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum