S
Sergey Topychkanov
When I try to apply SaveAs to FileUpload I receive Exception Access to file
denied when debugging on my local computer code for ASP.NET 3.5. I have
Windows Vista SP1 and Visual Studio 2008 Professional. Code is next
protected void BtnUpload_Click(object sender, EventArgs e)
{
string fileType = "image/pjpeg";
if (PictureFileUpload.PostedFile.ContentLength != 0) {
if (PictureFileUpload.PostedFile.ContentType == fileType)
{
LblContentType.Text =
PictureFileUpload.PostedFile.ContentType;
string destDir = Server.MapPath("");
string fileName = GetFileName();
string destPath = Path.Combine(destDir, fileName);
try
{
PictureFileUpload.SaveAs(destDir);
}
catch (Exception err){
LblContentType.Text = err.Message;
}
}
}
What to do? Please write me directly to (e-mail address removed)
denied when debugging on my local computer code for ASP.NET 3.5. I have
Windows Vista SP1 and Visual Studio 2008 Professional. Code is next
protected void BtnUpload_Click(object sender, EventArgs e)
{
string fileType = "image/pjpeg";
if (PictureFileUpload.PostedFile.ContentLength != 0) {
if (PictureFileUpload.PostedFile.ContentType == fileType)
{
LblContentType.Text =
PictureFileUpload.PostedFile.ContentType;
string destDir = Server.MapPath("");
string fileName = GetFileName();
string destPath = Path.Combine(destDir, fileName);
try
{
PictureFileUpload.SaveAs(destDir);
}
catch (Exception err){
LblContentType.Text = err.Message;
}
}
}
What to do? Please write me directly to (e-mail address removed)