Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5 ASP:NET
I am try to save Image through File Upload control in a sub directory or sub Folder.But I am getting a exception to
 
'E:\23-3-2013 ABC\Carkhojo\photos\Ford\FiestaAudi Q7 3.0 TDI quattro\Audi Q7 3.0 TDI quattro.jpg'
 
is not a valid virtual path.
Posted 30-Mar-13 1:03am
Comments
Mike Meinz at 30-Mar-13 6:10am
   
Is there a Drive E: ?
Does it contain a folder named 23-3-2013 ABC?
Does that folder contain a folder named Carkhojo?
Does that folder contain a folder named photos?
Does that folder contain a folder named Ford?
Does that folder contain a folder named FiestaAudi Q7 3.0 TDI quattro?
 
Paste the path into a Windows Explorer textbox and see what Windows Explorer says.
 
Start with Drive E: and select each subdirectory, in turn, to get to the lowest subdirectory, then copy paste from the Windows Explorer textbox into you source code.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

this will be Helpful for you
 

 
Server.MapPath(".") returns the current physical directory of the file (e.g. aspx) being executed
Server.MapPath("..") returns the parent directory
Server.MapPath("~") returns the physical path to the root of the application
Server.MapPath("/") returns the physical path to the root of the domain name (is not necessarily the same as the root of the application)
  Permalink  
Comments
Marcus Kramer at 4-Apr-13 15:13pm
   
When you copy/paste from another site, cite the source or you will get flagged for plagiarism and possibly have your account terminated.
Source

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 265
1 Sergey Alexandrovich Kryukov 202
2 George Jonsson 185
3 King Fisher 185
4 CPallini 155
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 30 Mar 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