xgzhen105

1.string filepath=FileUpload1.PostedFile.FileName;//获取上传文件的路径

2.string filename=filepath.Substring(filepath.LastIndexOf("\\")+1);//获取上传文件名称

3.string fileExtend=filepath.Substring(filepath.LastIndexOf(".")+1);//获取文件的扩展名

4.string fileSize=Convert.ToString(FileUpload1.PostedFile.ContenLength);//获取文件大小

5.string fileType=FileUpload1.PostecFile.ContentType;//获取文件类型

6.string serverPath=Server.MapPath("指定文件夹下")+filename;//保存到服务器的路径

7.FileUpload1.SavaAs(serverPath);//确定上传文件

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2021-10-02
  • 2021-11-06
  • 2021-10-02
  • 2021-10-03
  • 2021-12-19
  • 2021-11-20
  • 2021-06-17
猜你喜欢
  • 2021-10-02
  • 2021-10-02
  • 2021-10-02
  • 2021-12-28
  • 2021-10-02
  • 2021-10-03
  • 2021-08-15
相关资源
相似解决方案