Help! please! I'm really stumped with uploading an image file - decent challenge:)

Hi
I’m trying to upload a file to my web-site using the html and c# razor embedded code below running from ASP.NET.

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