hi, friends
i have used in this code. but this support to local. not support to FTP server side pls help this
cs coding:
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strCS);
con.Open();
SqlCommand cmd = new SqlCommand("Sp_Audio", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@song", FileUpload1.FileName);
cmd.ExecuteNonQuery();
if (FileUpload1.HasFile)
{
string fname = FileUpload1.FileName.ToString();
string folderpath = "Audio";
string path = HttpContext.Current.Server.MapPath(folderpath);
FileUpload1.PostedFile.SaveAs(path + "\\" + fname);
Response.Write("file upload sucessfully");
Response.Redirect("default3.aspx?song="+FileUpload1.FileName);
}
}
design code:
<table>
<tr><td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td></tr>
<tr>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
<tr><td>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /></td></tr>
</table>
server error: the connection was reset this error displayed in http:\\
chandru