FileInfo issue - C# ASP.NET

Joined
Nov 15, 2007
Messages
2
Reaction score
0
Hi,
I'm having a problem uploading an image when running a website from a share network. Could someone please give me some advice?

Here's my code:

*********************************
<Code behind>
string sfullpath = "C:\My Documents\My Pictures\Mypict.bmp";
FileInfo imgFile = new FileInfo(sfullpath);

if (!imgFile.Exists)
{
// Image not existed;
}
else
{
// Do something
}
************************************

Note: Everything is working fine if I run this website locally, but if I run it from another PC, it couldn't find the image file at all. However if I change sfullpath = "C:\Windows\Greenstone.bmp" it works fine. Is there something that I need to set from the web server to solve this problem? Please advice if you have any solutions. Thank you in advance.

Tinhtam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top