sonu,
Are you trying to copy the file on the local machine? Or to the c:\amit
directory on a web server (I don't know why you are using the HttpPostedFile
type).
If you want to upload a file to a website, you should use the UploadFile
method on the WebClient class. If you want to copy a file, then you want to
check the static Copy method on the File class.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"sonu" <kr*******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I want to upload files without file control.
suppose i have string "c:\test.txt"
i am using this
FileInfo Myfile= new System.IO.FileInfo("c:\test.txt");
string strBaseLocation = "c:\\amit\\";
objFile=(HttpPostedFile)Myfile; there is an error in this line cant
cast like this
objFile.SaveAs(strBaseLocation+Myfile.FullName);
please help me