Seems to happen with a file processing function? ~ is a special notation for the root of the web application which is never used "as is":
here it seems you want to use first Server.MapPath("~/output000.jpg") to convert that "virtual path" to a physical path such as "C:\inetpub\vs2012\EditSelfIntro4\output000.jpg"
else it is converted to a url such as "https://mysite.com/output000.jpg"
It allows to write code without having to know where your site will be installed but it needs to be converted to a physical path or an url before being used.
Contributor
6479 Points
5815 Posts
Reason of error
Aug 16, 2020 03:32 PM|wmec|LINK
Hi,
is the path to which I've deployed the project.
File output000.jpg, does exist within this path and what is the reason of error below?
Peter
All-Star
48570 Points
18082 Posts
Re: Reason of error
Aug 16, 2020 04:39 PM|PatriceSc|LINK
Hi,
Seems to happen with a file processing function? ~ is a special notation for the root of the web application which is never used "as is":
It allows to write code without having to know where your site will be installed but it needs to be converted to a physical path or an url before being used.
Contributor
6479 Points
5815 Posts
Re: Reason of error
Aug 17, 2020 01:20 AM|wmec|LINK
How to resolve issue to ensure it would refer to file in path below?
Peter
Participant
1630 Points
931 Posts
Re: Reason of error
Aug 17, 2020 04:42 AM|PaulTheSmith|LINK
Do you want us to fix your code? You will need to show your code!
Contributor
6479 Points
5815 Posts
Re: Reason of error
Aug 17, 2020 06:35 AM|wmec|LINK
Here is the line
leading to problem.
Peter
Participant
1630 Points
931 Posts
Re: Reason of error
Aug 17, 2020 07:10 AM|PaulTheSmith|LINK
PatriceSc has guessed that this was your code and shown the correct way to get the filename.
All-Star
48570 Points
18082 Posts
Re: Reason of error
Aug 17, 2020 12:03 PM|PatriceSc|LINK
So you try to copy a file found in a ~ folder. It should be for example :