1
通过上传我的.NET核心应用托管作为Azure的Web应用程序文件的时候,我发现了以下错误文件的时候:超时通过上传我的Azure的Web应用程序
你正在寻找一直的资源删除,更名或暂时不可用。
这是在Postman中测试的,在22秒左右超时时发现404 Not Found。
我的应用程序代码如下,剔除多余的东西:
public async Task<IActionResult> PostDocuments(ICollection<IFormFile> files)
{
foreach (var file in files)
{
string path = Path.Combine(uploadsDir, file.FileName);
//Uploading file to "uploads" to be staged. Doesn't get past here.
using (var stream = new FileStream(Path.Combine(uploadsDir, file.FileName), FileMode.Create))
{
await file.CopyToAsync(stream);
}
//Uploading files to Azure
if (await _azure.UploadFile(path, file.FileName)
{
// Stuff to add file to database
}
else
{
return StatusCode(400, "Could not upload one or all of your files.");
}
}
else
{
return StatusCode(400, "One or all of your files are empty, have invalid types, or are targeting mismatched buildings or floors.");
}
}
return StatusCode(201, files);
}
我相信我的问题很简单,就是要求的时间过长和Azure是取消它来维护应用程序的完整性。这听起来像是从我的研究中得知的,也许我需要允许应用程序启动Azure上载并将其添加到数据库。然而,从我的本地测试来看,这个过程的很长一段时间甚至还没有达到我的控制器的任何逻辑。有一个更好的方法吗?
是否有其他终结点工作?例如api/foos是否会返回任何内容? – trevorc
该应用程序中的所有内容均可用,包括上传少于22秒的文件上传。 – jackmusick
您正在测试的文件上传文件有多大,超时?有一个文件大小可以接受多大的设置。 – trevorc