tags:

views:

414

answers:

3

Hi, 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.

A: 
<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...

Shawn Simon
I am making changes to the PDF and saving the pdf. I am not changing its name or making a copy of it. Sorry. I may not understand your solution.
johnny
How exactly are you editing a PDF?
Kyralessa
With Adode Professional 7.1.0.
johnny
for example, I have to add a signature. The pdf has a signature line. I sign it. I click save. Can't save it if in the browser. There's something with the way adobe sees the url even it is using the UNC that isn't "normal" like when using the full app.
johnny
Saving it to where ?
Shawn Simon
back to the server where it was loaded from via the unc. It has the iframe src=someunc that's the same path to save from.
johnny
A: 

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.

ck
But I am using a local unc already. Why can't I just hit save?
johnny
+2  A: 

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.

Darryl Braaten