我有错误当调用方法amazons3.ListObjects时,请求时间和当前时间之间的差异太大
ListObjectsRequest request = new ListObjectsRequest() {
BucketName = BucketName, Prefix = fullKey
};
using (ListObjectsResponse response = s3Client.ListObjects(request))
{
bool result = response.S3Objects.Count > 0;
return result;
}
Run Code Online (Sandbox Code Playgroud)
可能是什么?
我正在尝试在S3中处理上传的文件.由于getObject是异步主函数在处理完成之前结束,因此AWS在3-4秒内杀死lambda.
更糟糕的是,处理方法中还包含异步操作 - 它会进行http调用.
在高级别,我的代码看起来像:
exports.handler = function(event, context) {
// Get the object from the event and show its content type
var bucket = event.Records[0].s3.bucket.name;
var key = event.Records[0].s3.object.key;
var params = {
Bucket: bucket,
Key: key
};
s3.getObject(params, function(err, data) {
if (err) {
...
} else {
processFile(data.Body.toString(), 0);
console.log("ok");
}
});
//need to wait here till processFile is done
};
processFile = function(content, start) {
... build url to call
http.get(url, function(res) {
console.log("Got …Run Code Online (Sandbox Code Playgroud) 我试图使用以下代码从元素中找到父表单:
<form id="f1" action="action1.html">
form1 <button id="btn1" onclick="testaction(this); return false;" >test form 1</button>
</form>
<script type="text/javascript" >
function testaction(element) {
var e = $(element.id);
var form = e.parent('form');
alert(form.id); // undefined!!
alert(form.action); // undefined!!
alert(document.forms[0].action); //http://localhost/action1.html
}
</script>
Run Code Online (Sandbox Code Playgroud)
它应该是非常简单的事情....提前谢谢
我记得像' 明确 ' 这样的东西,谷歌说nunit有这样的属性.Microsoft.VisualStudio.TestTools.UnitTesting是否提供类似这样的内容?
我需要实现RichTextEditors非常常见的任务 - 从剪贴板中获取HTML.任何人都可以帮助指导如何解决这个任务?
它必须是跨平台(IE,FF,Chrome,Opera).我刚从这段代码开始:
<script type="text/javascript">
$('.historyText').live('input paste', function(e) {
var paste = e.clipboardData && e.clipboardData.getData ?
e.clipboardData.getData('text/plain') : // Standard
window.clipboardData && window.clipboardData.getData ?
window.clipboardData.getData('Text') : // MS
false;
alert(paste);
});</script>
Run Code Online (Sandbox Code Playgroud)
window.clipboardData和e.clipboardData都为null(Chrome,Firefox).
更新:用户想要粘贴其他浏览器窗口中的文章内容,我需要获取html标签.
我试图这样做,它导致contentlen 0的结果
看起来像:
[OutputCache(Duration = 36000)]
public JsonResult GetFileClasses()
{
return this.Json(TopicConfig.FileExtensionsSettings.List)
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
应用程序能够在OnError中记录错误,但是我们无法进行任何重定向,因此无法向用户显示有意义的内容.有任何想法吗?我知道我们可以在web.config中设置maxRequestLength,但无论如何用户都可以超过这个限制,并且需要显示一些正常的错误.
.net asp.net file-upload maxrequestlength application-onerror
我想为我的asp.net Web应用程序存储在S3中的文件设置过期日期标题.
我们正在实现长时间运行的进程,用asp.net 3下载数据库内容为xml.
总文档生成时间约为3-5分钟,我们希望尽快回复第一个字节.我们已经覆盖System.Web.Mvc.FileResult并正在尝试执行以下操作:
protected override void WriteFile(HttpResponseBase response)
{
Stream outputStream = response.OutputStream;
byte[] header = xmlExportService.XmlHeader();
response.Flush();
outputStream.Write(header, 0, header.Length);
response.Flush();
//// some long running generation here
}
Run Code Online (Sandbox Code Playgroud)
在Windows 7下的本地iis上,我在浏览器中收集"保存文件"对话框.在生产时,Windows Server 2008 R2在生成整个文件之前没有对话框.
有任何想法吗?
我可以通过扩展以某种方式在S3中搜索对象,而不仅仅是通过前缀?
这是我现在拥有的:
ListObjectsResponse r = s3Client.ListObjects(new Amazon.S3.Model.ListObjectsRequest()
{
BucketName = BucketName,
Marker = marker,
Prefix = folder,
MaxKeys = 1000
});
Run Code Online (Sandbox Code Playgroud)
所以,我需要在我的桶中列出所有*.xls文件.
amazon-s3 ×3
.net ×2
asp.net-mvc ×2
c# ×2
asp.net ×1
aws-lambda ×1
clipboard ×1
download ×1
file-upload ×1
javascript ×1
jquery ×1
json ×1
node.js ×1
outputcache ×1
unit-testing ×1