Solved

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

Posted on 2014-02-16
4
250 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
Comment Utility
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
Comment Utility
I've requested that this question be deleted for the following reason:

not much response
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
There is not much response because the only answer is #a39865092
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now