Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..
Iam using web application and having a file inside Import folder in my C drive and having empty folder called Export in the same drive. How to set path in web config file that while export button is clicked,file moved to export folder with local host url...guide soon
Posted

1 solution

use Server.MapPath("URL") to get physical path then move it from source ot destination.

hope it helps
mark answer if helped.
 
Share this answer
 
Comments
Priyaaammu 10-Dec-12 5:32am    
thanks for your reply.........i tried that,but getting error as "...is not a valid virtual path". Can you please send my example code to declare url
AnkitGoel.com 10-Dec-12 5:34am    
what have u tried? send your code
Priyaaammu 10-Dec-12 5:42am    
This i added in web.config file,
<add key="importUrl" value="C:/Import">
<add key="exportUrl" value="C:/Export">


In my pageload event,i wrote as..
string import_dir = "",importurl = "", exporturl = "", export_dir = "";
import_dir = ConfigurationSettings.AppSettings["importurl"].ToString();
export_dir = ConfigurationSettings.AppSettings["exporturl"].ToString();
string downloadURL = "http://localhost";
var path = Server.MapPath(export_dir);
AnkitGoel.com 10-Dec-12 5:44am    
what are u passing in import_dir and export_dir ?
Priyaaammu 10-Dec-12 5:46am    
I gave importurl="C:/Import",exporturl="C:/Export" in config file

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