[WebMethod] public void uploadFile (string filename, byte[] data) { if (File.Exists(Server.MapPath("appUpdate\\") + filename)) { File.Delete(Server.MapPath("appUpdate\\") + filename); } FileStream fs = File.Create(Server.MapPath("appUpdate\\") + filename); fs.Write(data, 0, data.Length); fs.Close(); }