943,587 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 1252
  • C# RSS
Aug 13th, 2009
0

Get the path from Downloading dialogbox???

Expand Post »
Hi everybody...

I have struck in a issue which is explained below. Pls resolve it...

I have an download option in my web application(ASP.Net with C#), which brings an dialogbox asking where to save the file. But i want to get the path of the file which is going to give by the user, because i have to start a new process to install the downloaded file by giving the path. I am using the following code to download the file, it works fine but i need to fetch the destination path of the file. Please help me out...

Thanks in advance...
This is my code.......
            Response.ClearContent();
            Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
            Response.AddHeader("Content-Length", file.Length.ToString());
            Response.ContentType = filepath;
            Response.TransmitFile(file.FullName);
            Response.Flush();
            Response.End();
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
razmca is offline Offline
9 posts
since Feb 2009
Aug 13th, 2009
0

Re: Get the path from Downloading dialogbox???

You can't really determine what path they're saving the file to-- that dialog box is something the browser uses exclusively. Why not make the application itself determine what directory it's in, then go from there?
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Aug 14th, 2009
0

Re: Get the path from Downloading dialogbox???

Thanks alc6379,

Sorry i am a very new beginner for c#.net. Can u please help me to shape the code with right path.. Sample code is more preferrable..
Last edited by razmca; Aug 14th, 2009 at 12:42 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
razmca is offline Offline
9 posts
since Feb 2009
Aug 14th, 2009
0

Re: Get the path from Downloading dialogbox???

For security and other reasons, the browser's download dialog does not give you their local path information. You need to create a custom download dialog for your server's app. that allows the user to directly input the path you want to pass to your new process.

Is it possible for you to launch the new process with a default or blank path and that the process's saveas dialog can handle the details without you needing to actually know the path in your app?
Reputation Points: 341
Solved Threads: 233
Posting Shark
DdoubleD is offline Offline
984 posts
since Jul 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Java Applet In C#...
Next Thread in C# Forum Timeline: "IBMDADB2" failed, error:E_FAIL(0X80004005)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC