0
在服務器上保存doc文件我的問題是,此代碼下載docx在客戶端(Response.write ..)但我想下載它在specefic路徑(在服務器)我該怎麼做?如何通過response.write
private void htmlToDoc(string html)
{
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/msword";
string strFileName = "docName" + ".doc";
Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);
StringBuilder strHTMLContent = new StringBuilder();
strHTMLContent.Append("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:word\" xmlns=\"http://www.w3.org/TR/REC-html40\"><head></head><body>");
strHTMLContent.Append(html);
strHTMLContent.Append("</body></html>");
Response.Write(strHTMLContent);
Response.End();
Response.Flush();
// return strHTMLContent;
}
我必須保存在服務器上的文件,因爲最後我把它變成一個zip文件,所以我必須保持它在服務器上可能有另一種方式? – saleem