Help please if you know how to upload a file!

Hi
I’m trying to upload a file to my web-site using the code below.

I’ve marked where it crashes where it says:-
strFileName = Path.GetFileName(theImage.FileName); /* Crashing on this line !!!

I’m really stumped. Please can anyone get me going again.

This is my code :-

@{
var image = “”;

WebImage theImage = null;
var strFileName="";
var strImgPath="";

if (IsPost){
    theImage = WebImage.GetImageFromRequest();

    strFileName = Path.GetFileName(theImage.FileName); /* Crashing on this line !!!!!!!!!!!!!!!!!!!!
    strImgPath = @"images\\" + strFileName;
    theImage.Save(@"~\\"+strImgPath);
}

}

<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“utf-8” />
<title>The Matrix Man</title>
<link href=“StyleSheet1.css” rel=“stylesheet” type=“text/css” />
</head>
<body>
<!-- This is start of a new website that is going to reach new heights of design never seen before –>
<div id=“header”>
</div> <!-- end of header div –>

    &lt;div id="bodycontent"&gt;
        &lt;form action="" method="post" enctype="multipart/form-data"&gt;
            Enter you file path to upload an image...
            &lt;input type="file" name="image" value="@image" /&gt;
            &lt;input type="submit" value="Upload" /&gt;
        &lt;/form&gt;
    &lt;/div&gt; &lt;!-- end of bodycontent div --&gt;

&lt;/body&gt;

</html>

Cheers
Matt

Hi
Its ok - a pc reboot fixed this - not sure how though!!

cheers
Matt