Click here to Skip to main content
15,904,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

In my asp.net there is option to download some data as txt file ,I want to create a folder in client system d drive when we click the download button. that is when i click download button a new folder with current date as foldername creates and txt file should download inside it . is it possible.
Posted

You cannot create Folder in the Client Machine. but using ActiveX ,you can. that too in IE only..

Reference Links:
create folder on client machine[^]

http://forums.asp.net/post/2733061.aspx[^]
 
Share this answer
 
v2
Comments
Praveen_P 29-Jan-14 23:15pm    
thanks and 5 !
Karthik_Mahalingam 29-Jan-14 23:33pm    
Welcome Praveen:)
Praveen_P 29-Jan-14 23:26pm    
Can i overwrite a file while downloading if same filename already present in downloads folder
Karthik_Mahalingam 29-Jan-14 23:34pm    
it wont over write, it will save as filename(1) (2) etc.. check in chrome..
Praveen_P 29-Jan-14 23:39pm    
is there any way to overwrite files
As you properly states download occurs in client side! AS such the only code you have there is what inside your page with the download button - JavaScript...
For security reasons JavaScript can not access the clients' machine and you can not set the target folder for downloading - it's something the user have to choose...
 
Share this answer
 
Comments
Praveen_P 29-Jan-14 23:15pm    
Thanks
This is not allowed and it is for security reasons. If any Web App will manipulate the File System, then it will be risk to computer as it can do harm to computer if possible.

So, simply, don't do this. User should get the preference of choosing the folder, where he/she can save the file.
 
Share this answer
 
Comments
Praveen_P 29-Jan-14 23:16pm    
thanks
Please accept this answer, if it has helped you in any way.
This will help others to find the answer in one go and you will also be awarded with some points for this action...

Thanks,
Tadit
Praveen_P 29-Jan-14 23:31pm    
By default the file i'm downloading from my application saves to downloads folder , can i change it to any other folder using asp code(where i manually create the folder in the client system)
As I have already mentioned in my answer, you can't do that.
Praveen_P 29-Jan-14 23:38pm    
Sorry.. i mean if there is already folder in client machine say 'Fd', then can i download files to this folder 'Fd'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900