Click here to Skip to main content
16,021,294 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using file upload control



File Not Supporting to uploadSystem.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma'. File name: 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at BrowseImage.UIUtilities.ReadFile(String PostedFileName, String[] filetype) in d:\179 GlobalIndactinationSignaturesystem\GlobalIndactinationSignaturesystem\UserControls\BrowseFile.ascx.cs:line 65
Posted
Comments
deepakaitr12345 13-Apr-12 6:52am    
Please verify
1)Have you checked the extansion of file when upload
2)file size restriction
3)check the path where you are uploading the file

Thanks
ZurdoDev 13-Apr-12 8:34am    
It says FileNotFoundException. That means the file is not there or there is not enough security to get at it.
[no name] 17-Apr-12 21:51pm    
Most likely, your website does not have permission to read/write to that directory.

1 solution

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma" sounds as you are using relative paths ("New Stories (Highway Blues).wma") in the context of Visual Studio (which sets the working directory to C:\...Commen7\IDE\).

You should pass the full path.
You can use
C#
string path = System.IO.Path.GetDirectoryName(
   System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );

to obtain the directory path to the directory of your application.

C#
File.Open(path + "\\New Stories (Highway Blues).wma");

should work then.
 
Share this answer
 

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