Solved

Retrieving the browsed path in the file dialog & save it using the browsed path in future

Posted on 2014-02-16
4
257 Views
Last Modified: 2014-02-21
By using the code, it would save the pdf file to the browsed location in the file dialog

just if possible if it could anyhow retrieve the browsed location (from the file dialog) to a textbox

and use path in the textbox and save the pdf file back to this path (from the textbox) ?

private static void SetResponse(string fileName)
    {
        string attachment = "attachment; filename=" + fileName + ".pdf";
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.AddHeader("content-disposition", attachment);
        HttpContext.Current.Response.ContentType = "pdf";
        HttpContext.Current.Response.AddHeader("Pragma", "public");
    }

  protected void btnSave_Click(object sender, EventArgs e)
    {
      

        FileStream fs = File.OpenRead(Server.MapPath("~/Scripts/1.pdf"));

        byte[] buffer = new byte[(int)fs.Length];
        fs.Read(buffer, 0, (int)fs.Length);
        fs.Close();
        SetResponse("pdfName");
        HttpContext.Current.Response.BinaryWrite(buffer);
        HttpContext.Current.Response.Flush();
        HttpContext.Current.Response.Close();

        dNextCopyRunningNumber += 1;

        bSaved = true;


    }

Open in new window

0
Comment
Question by:doramail05
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39865092
That information is not available - it would be a security issue if you knew the folder structure of someones pc.
0
 
LVL 1

Author Comment

by:doramail05
ID: 39875680
I've requested that this question be deleted for the following reason:

not much response
0
 
LVL 58

Expert Comment

by:Gary
ID: 39875681
There is not much response because the only answer is #a39865092
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Gridview 1 45
Linq asp.net mvc 13 17
asp.net input html code have it display the content 2 21
Testing of the web services 1 31
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question