Get the path from Downloading dialogbox???

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2009
Posts: 9
Reputation: razmca is an unknown quantity at this point 
Solved Threads: 0
razmca razmca is offline Offline
Newbie Poster

Get the path from Downloading dialogbox???

 
0
  #1
Aug 13th, 2009
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();
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Get the path from Downloading dialogbox???

 
0
  #2
Aug 13th, 2009
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?
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 9
Reputation: razmca is an unknown quantity at this point 
Solved Threads: 0
razmca razmca is offline Offline
Newbie Poster

Re: Get the path from Downloading dialogbox???

 
0
  #3
Aug 14th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 901
Reputation: DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough 
Solved Threads: 142
DdoubleD DdoubleD is offline Offline
Posting Shark

Re: Get the path from Downloading dialogbox???

 
0
  #4
Aug 14th, 2009
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC