I tried that but I'm doing something wrong as its not working.
Sorry but i'm really new to this.
Here is my code:
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>
<script language="C#" runat="server">
void Button1_Click(object Source, EventArgs e){
string id = Request.QueryString["id"];
Response.Write (id);
if (File1.PostedFile != null){
try{
File1.PostedFile.SaveAs(Server.MapPath("uploads//")+"big"+id+".jpg");
Span1.InnerHtml = "File uploaded successfully: "+"big"+id+".jpg";
System.Drawing.Image img1 = System.Drawing.Image.FromFile(Server.MapPath("uploads//")+"big"+id+".jpg");
System.Drawing.Image bmp1 = img1.GetThumbnailImage(116, 82, null, IntPtr.Zero);
bmp1.Save(MapPath("uploads//")+"small"+id+".jpg");
ThumbnailImage.ImageUrl = "uploads//"+"small"+id+".jpg";
}
catch (Exception exc){
Span1.InnerHtml = "Error saving file" + "big"+id+".jpg" + "" + exc.ToString();
}
}
}
</script>
</head>
<body>
<form enctype="multipart/form-data" runat="server">
<p>File to Upload:
<input id="File1" type="file" runat="server">
<br>
<input type=button id="Button1" value="Upload" OnServerClick="Button1_Click" runat="server">
</p>
<p><span id=Span1 style="font: 8pt verdana;" runat="server" /></p>
</form>
</body>
</html>
Here is the error i'm getting:
Compiler Error Message: CS0103: The name 'ThumbnailImage' does not exist in the current context