Solved

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

Posted on 2014-02-16
4
253 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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 …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

22 Experts available now in Live!

Get 1:1 Help Now