Reputation: 19735
I have a file that I can get to with the UNC \mypath\myfile. I retrieve the path with c# and assign it to a link. The browser opens the file inside itself (ie display in the browser) without problem. But, when I try and save to \mypath\myfile I am prompted to save it locally. If I view the file outside of the browser (IE 7) I can edit and save as expected, again, via the UNC.
What I trying to do is use iframe to display the file from my UNC (file:///\mypath\myfile), which does work, but now I can't edit it. Outside the browser I can.
Is there anyway to save a PDF when displaying it inside the browser? I also tried a button to use the save method on the pdf, but it did not work.
Thank you.
I am using IE 7 and Adobe Professional 7.1.0.
Upvotes: 2
Views: 709
Reputation: 5231
When you open a file via a web browser the web browser downloads the file locally, then sends a local file path to the application that opens it. Even in the case you are using a UNC in your href Adobe does not get that UNC path to save back to, it is getting a local machine path. Keep in mind the browser does the same thing even if the UNC is a local machine path.
I don't think that the behavior you want is possible.
Upvotes: 2
Reputation: 46425
Saving a PDF in your browser (through File-Save As in IE etc) or Save A Copy in the Adobe system will always prompt you to save it locally. You could navigate manually to your UNC path, but this is browser behaviour, not server behaviour.
Upvotes: 0
Reputation: 19803
<body>
<div style="height:80px">
<p><a href="downloadpdf.aspx" target="_blank">Save</a>
</div>
<div>
<iframe width="100%" height="100%" src="pdfname.pdf" />
</div>
</body>
On downloadpdf.aspx's page load event,add:
Response.AddHeader("content-disposition","attachment; filename=pdfname.pdf")
Response.ContentType = "application/pdf"
Server.Transfer("pdfname.pdf")
Untested, but should give you an idea...
Upvotes: 0