异常“不支持给定的文件格式”,in
ContentFeed
.find({
filter: {
where: {
"content.value": {regexp: $scope.searchText + '/i'}
}
}
}).$promise
,下面是我的代码
QVector<float> values;
int size = lines.size();
for(int i=0; i < size; i++)
{
bool ok=false;
float value = lines.at(i).toFloat(&ok);
if(ok)
values.push_back(value);
}
答案 0 :(得分:0)
我认为你还必须插入文件名。
试试这个 -
HttpContext.Current.Response.WriteFile(DocumentPath+ FileName);
<强>更新强>
试试这行代码
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;filename="test.xls");
而不是这个 -
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=" + FileName);
HttpContext.Current.Response.AddHeader("Content-Type", "application/octet-stream");
更新2
简短的回答是,无法出于安全原因在客户端的计算机上保存文件。 所以你能做的只是这一行
Response.AddHeader("Content-Disposition", "attachment;filename="+fileName);
没有DocumentPath
。
上次更新
//write file to the server
string lines = "First line.\r\nSecond line.\r\nThird line.";
System.IO.StreamWriter file = new System.IO.StreamWriter("test.txt");
file.WriteLine(lines);
file.Close();
//read the file from server
string david = File.ReadAllText("test.txt");