function filewrite(){
	var ajax = getAjax();
	var result = document.getElementById("link");

	if(ajax){
		try{
			ajax.onreadystatechange = getData;
		}catch(e){
			result.innerHTML = "onreadystatechange error!"
		}

		try{
			ajax.open("GET","//localhost:8000/images/"+document.cameracontrol.input.value+".tif",true);
			ajax.responseType = 'blob'
		}catch(e){
			result.innerHTML = "ajax open error!";
		}

		try{
			ajax.send(null);
		}catch(e){
			result.innerHTML = "send error!";
		}
	}else{
		result.innerHTML = "you cannot use ajax...";
	}

	function getData(){
		if(ajax.readyState == 4){
			if(ajax.status == 200){
	var url = window.URL.createObjectURL(this.response)
		dl_name = document.cameracontrol.dlname.value+"_"+document.cameracontrol.mode.value;
	result.innerHTML = '<a href="'+url+'" download='+dl_name+'>download_link</a>';
			}else{
	result.innerHTML = "HTTP error!";
			}
		}else{
			result.innerHTML = "HTTP Transmission!";
		}
	}

}

