3

Why I'm getting this error. My variables get the names from request, and also i tried "data.qext" but visual studio give me error.

I got "test.pdf" file in my WebsiteRoot/uploads/files/test.pdf, but still there is an error. Maybe I'm missing something?

Check image for detailed description: http://prntscr.com/7wnid

4
  • Do you have an HttpContext? Looks like you HttpContext.Current.Sever is null... Commented Apr 9, 2012 at 0:37
  • If you mean about this, yes ofc i have prntscr.com/7wnrc Commented Apr 9, 2012 at 0:39
  • 1
    I mean... when you debug, if you pass your mouse over HttpContext.Current.Sever... does it show something or is it null? Commented Apr 9, 2012 at 0:40
  • Oh wow, i noticed that but i throw it cant be my error since i never got it. Commented Apr 9, 2012 at 0:45

1 Answer 1

2

You can try this method instead of HttpContext.Current.Server.MapPath:

System.Web.Hosting.HostingEnvironment.MapPath()

Doing so, there's no need for an HttpContext.

Sign up to request clarification or add additional context in comments.

1 Comment

Since i got my error with HttpContext.Current.Sever.MapPath inside my other functions, this definitely solve my problem. THANKS!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.