Is it possible to specify a web service as the source for an iFrame?
I am trying to get File Download working but since my file is stored as Binary in SQL Server, i cannot point user to the specific file. I have to fetch the file, process it and prompt user to save/open dialog. I was wondering if there is a way i can point an iFrame to a webservice call which will be responsible for processing the file download request?
I have tried the below code but it doesnt work.
Any idea what am i missing here?
<iframe id="downloadFrame" style="display:none"></iframe>
<input type="button" value="Download File" title="Download File" onclick = "JavaScript: return downloadFlie();" />
function downloadFlie()
{
var iframe = document.getElementById("downloadFrame");
iframe.src = "Services/svcAttachments.asmx/DownloadFile?FileId=5";
return false
}
Why not just use an anchor and a target?