Click here to Skip to main content
12,635,671 members (25,197 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
I used file upload control to upload the files,
for that I need to save extension of that file to my database
for that I used
string str= Path.GetExtension(FileUpload1.PostedFile.FileName);


when I run my app I am getting the follwoing error
"The name 'Path' does not exist in the current context"
why what does it mean?
Posted 3-Feb-11 20:26pm
Updated 3-Feb-11 20:32pm
m@dhu29.7K
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use

System.IO.Path
  Permalink  
Comments
SAKryukov 4-Feb-11 1:53am
   
Simple as that - a 5.
I would also said "shame on you" to OP :-)
--SA
sasirekhareddy 7-Sep-13 7:48am
   
works fine
Sandeep Mewara 4-Feb-11 3:37am
   
Common OP is a beginner, it happens! :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Please add this on top of the code behind page
using System.IO;
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

for this there is only one solution that is
use namespace
System.IO;
  Permalink  
Comments
balu.n6 3-Apr-12 9:27am
   
i tried but doesn't solve the problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 5 Jul 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100