tags:

views:

48

answers:

2

Hi,

In my application when I click on one of my button in the page it is giving error like this..

Could not find a part of the path 'V:\User\EnterTrailorVideos\luck.swf'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:

System.IO.DirectoryNotFoundException: 
  Could not find a part of the path 'V:\User\EnterTrailorVideos\luck.swf'.

There is No folder ("EnterTrailorVideos") in my project. But it is showing like this can you help me?

This the code:

string path = Page.MapPath("../../User/VideoOut/"+sFile);
FileUplvideo.PostedFile.SaveAs(path);
Session["oldfile"] = path;
A: 

Something in your code is looking for that file, and you're getting an error when it's not there. I'm not sure how to provide more information that look for where that directory path is used in your code.

If you look at the full stack trace on that page you should see the code that's causing the (probably File.Open?) that's trying to read/fetch that file, the filename itself may be dynamic, this is a shot in the dark here...if you can update the question with a full stack trace, it'd be easier to say where the source of the error is, that's one of the main reasons for the stack trace :)

Nick Craver
jut now i edited my page please check out
Surya sasidhar
@Surya - I don't think that's the code causing the error...can you post the full stack trace from the error page?
Nick Craver
yes Mr. Nick Craver i will send it
Surya sasidhar
Mr.Nick Craver i got the solution for this i just write like this string path = Page.MapPath("~/User/VideoOut/"+sFile);
Surya sasidhar
Thank you for response Mr.Nick Craver
Surya sasidhar
A: 

Are you trying to upload the file on button_click event? Next check if you are accessing the file path from a web .config settings before using the map path since your map path has no reference to "EnterTrailerVideos" . As others have answered before the stack trace will show you exactly which code is causing the problem.

HTH

Raja
yes Mr. Raja i am uploading the video
Surya sasidhar
Please post the whole button_click event code or post the full stack trace from the error page since as Nick has said I don't see any problem with your code.
Raja
ya i got the solution Raja just simple .. string path = Page.MapPath("~/User/VideoOut/"+sFile);i write like this
Surya sasidhar
Thank you for response Mr.Raja
Surya sasidhar