<cfprocessingdirective pageencoding="utf-8"> <cfcontent type="text/html; charset=utf-8"> <cfset setEncoding("URL", "utf-8")> <cfset setEncoding("Form", "utf-8")> <cfset serverPath = "D:/wwwroot/srcfile/"> <cffile action="upload" filefield="form.Filedata" nameconflict="Overwrite" destination="#serverPath#"> |
2.ASP.Net
string saveToFolder = "savedFiles" private void Page_Load(object sender, System.EventArgs e) { HttpFileCollection uploadedFiles = Request.Files; string Path = Server.MapPath(saveToFolder); for(int i = 0 ; i < uploadedFiles.Count ; i++) { HttpPostedFile F = uploadedFiles[i]; if(uploadedFiles[i] != null && F.ContentLength > 0) { string newName = F.FileName.Substring(F.FileName.LastIndexOf("//") + 1); F.SaveAs(Path + "/" + newName); } } } |
3.PHP
<?php
有关ASP.NET上传后台程序(修正版) 代码: 注意点: |