---
title: "浏览器从服务器下载文件"
author: "rock"
date: "2010-06-01T10:16:28Z"
tags: []
categories: ["互联网"]
slug: "untitled"
draft: false
lastmod: "2010-06-01T10:16:28Z"
id: 680615
url: "https://rock.iteye.com/blog/680615"
---

浏览器从服务器端下载文件的方法：  
    其实本质是发送request（get，post皆可），服务端返回文嘉格式的response，这样浏览器就会弹出保存框了。这样文件的生成，即使在服务器端处理生成的了。  
     
        response header:

             Content-Disposition:attachment;filename="12345.xls"

             Content-Type:application/vnd.ms-excel