Click here to Skip to main content
Rate this: bad
good
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
Edited 3-Feb-11 20:32pm
m@dhu29.5K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use
 
System.IO.Path
  Permalink  
Comments
SAKryukov at 4-Feb-11 1:53am
   
Simple as that - a 5.
I would also said "shame on you" to OP :-)
--SA
sasirekhareddy at 7-Sep-13 7:48am
   
works fine
Sandeep Mewara at 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 at 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
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 334
2 CPallini 275
3 DamithSL 230
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 1 Oct 2013
Copyright © CodeProject, 1999-2014
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