Solved

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

Posted on 2014-02-16
4
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

763 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