Click here to Skip to main content
16,012,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to save attachment customized path.
Example: folder: -->TestProject
--App_code
--Bin
--uploadfile.aspx
I need to save attachment file in out side of this path
example: D:/Attachment/

please any one help me. Thank u ..
Posted

i think this should be help you


fileupload1.saveas("D:/Attachment/file1.text")
 
Share this answer
 
Comments
godbrother3 8-Oct-13 7:31am    
Thank u for quick response..
open the attachment i tried
Server.MapPath("D:/attachment/file1.txt");
i m getting error ( "D:/attachment/file1.txt" is not a valid virtual path.);
Thank u once again..
please don't use server.mappath

beacause server.mappath indicate your current position in project

and what control you use for save file like fileuploader
 
Share this answer
 
Comments
godbrother3 8-Oct-13 8:26am    
telerik RadAsyncUpload i am using.
sorry too late reply..
Thank u..
godbrother3 11-Oct-13 7:01am    
I want to save the file in server folder. But not in virtual path.
I want to save in server physical path.
Try
C#
FileUpload1.SaveAs("c:\\SaveDirectory\\" + FileUpload1.FileName);

Here complete example - ASP.NET - File Uploading[^]

But you'll get error if you didn't apply permissions for Write. To do that, check the below page.
How Do I Allow My Web Application to Write to Files, Folders and Databases?[^]
 
Share this answer
 
Comments
godbrother3 11-Oct-13 7:00am    
I want to save the file in server folder. But not in virtual path.
I want to save in server physical path.

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