未捕获的TypeError:angular.lowercase不是函数
我的angularjs应用程序中出现此错误,并且整个应用程序未运行.这是它的表现textAngular-sanitize.js:413
.
无法调试,我尝试使用与angular.js相同的版本,但没有成功.请为我提供解决方案.我没有任何东西可以在控制台中与此错误消息分享.
textAngular-sanitize.js:413 Uncaught TypeError: angular.lowercase is not a function
at parseEndTag (textAngular-sanitize.js:413)
at htmlParser (textAngular-sanitize.js:378)
at textAngular-sanitize.js:147
at textAngularSetup.js:443
at Object.invoke (angular.js:5093)
at angular.js:4892
at forEach (angular.js:374)
at createInjector (angular.js:4892)
at doBootstrap (angular.js:1923)
at bootstrap (angular.js:1944)
Run Code Online (Sandbox Code Playgroud) 我想做的是使用 httpclient 下载文件。目前我的代码如下。
HttpClient client = HttpClientBuilder.create().build();
HttpGet request = new HttpGet(downloadURL);
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null) {
FileOutputStream fos = new FileOutputStream("C:\\file");
entity.writeTo(fos);
fos.close();
}
Run Code Online (Sandbox Code Playgroud)
我的下载网址是这样的:http://example.com/file/afz938f348dfa3
正如您所看到的,该文件没有扩展名(至少在网址中),但是,当我使用普通浏览器访问该网址时,它确实会下载文件“asdasdaasda.txt”或“asdasdasdsd.pdf”(名称与网址不同,扩展名并不总是相同,取决于我尝试下载的内容)。
我的 http 响应如下所示:
日期:2017 年 5 月 29 日星期一 14:57:14 GMT 服务器:Apache/2.4.10 内容处置:附件;filename="149606814324_testfile.txt" 接受范围:字节 缓存控制:public,max-age=0 最后修改时间:2017 年 5 月 29 日星期一 14:29:06 GMT Etag:W/"ead-15c549c4678-gzip" 内容-类型:文本/纯文本;字符集 = UTF-8 变化:接受编码 内容编码:gzip 内容长度:2554 保持活动:超时 = 5,最大 = 100 连接:保持活动
我怎样才能让我的java代码自动下载具有良好名称和扩展名的文件到特定文件夹中?