Click here to Skip to main content
15,880,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 23-Jun-16 0:40am
Comments
Mike Meinz 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

this will be Helpful for you



VB
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)
 
Share this answer
 
Comments
fjdiewornncalwe 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900