﻿AppFilePath = "";

function SaveFile(srcFileToSave)
{
	//if not exists - create iframe 0x0
	var Ifrm = document.getElementById("ifrmFile");
	if(Ifrm == null)
	{
		Ifrm = document.createElement("iframe");
		Ifrm.height = "0px";
		Ifrm.width = "0px";
		Ifrm.id = "ifrmFile";
	}
	
	var QRST = AppFilePath+"SaveAs.aspx?file="+srcFileToSave;
	//append iframe to body
	var body = document.getElementsByTagName("body")[0];
	body.appendChild(Ifrm);
	//fill iframe source
	Ifrm.src = QRST;
}

function SaveFile(srcFileToSave,ifrmName)
{
    var Ifrm = document.getElementById(ifrmName);
    var QRST = AppFilePath+"SaveAs.aspx?file="+srcFileToSave;
    Ifrm.src = QRST;
}

