Eylam
Eylam
关注数: 13
粉丝数: 51
发帖数: 864
关注贴吧数: 24
一年没玩,麻烦大神推荐一套短爆组合 一年没玩酷跑了,现在游戏已经更新得不知从何下手了,就先麻烦大神推荐一套短爆组合吧,小女子感激不尽!
content-disposition filename文件名如何设置成动态变量 写了一个作业上交系统,上传文件时填写学号姓名就能把文件名重命名为“学号_姓名.zip”,现在想下载下来的文件名还是“学号_姓名.zip”,但是不知道content-disposition filename怎么赋值,在网上百度到的只能指定文件名,代码如下: function download(response, request){ //读文件,返回给浏览器 //下载链接里包含了文件名,提取出来,再识别出来 //下载链接的url怎么得到? var downloadUrl = url.parse(request.url, true).query; console.log(downloadUrl); console.log(downloadUrl.file); var fileName = downloadUrl.file; fs.readFile("./homework/"+fileName, "binary", function(error, file) { if (error) { response.writeHead(500, {"Content-Type" : "text/plain"}); response.write(error + "\n"); response.end(); } else { //console.log(fileName); response.writeHead(200, {"Content-Type" : "application/zip", "Content-Disposition" : "attachment; filename=fileName.zip"}); response.write(file, "binary"); response.end(); } }); }这样下载来的文件名永远是“fileName.zip”,我想让它变成“学号_姓名.zip”的形式,求大神们告知filename怎么赋值啊?
过了今晚还能用小丑兑换奖品吗? 如题,我看大家都还没兑换,但是离活动结束只有1小时了,是过了今晚还能兑换吗?
1
下一页