Azure.mp4上载失败



早上好,

我们已经在Azure应用程序服务上设置了一个Laravel项目。我们正在研究上传.mp4文件的能力。如果我们尝试上传.zip、.jpg、.doc等,它们都能正常工作。不过.mp4文件总是会出现错误。我们找到的大多数答案都是web.config,但我们认为它是正确的。以下是一些信息:

我们得到的错误:404未找到:您要查找的资源已被删除、名称已更改或暂时不可用。

我的web.config文件位置是:D:\home\site\wwwroot\public\web.config

我的上传目录是:D:\home\site\wwwroot\public\test

我的web.config看起来像:

<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="application/octet-stream" />
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
<handlers accessPolicy="Read, Script">
<add name="PHP71_via_FastCGI" path="*.php" verb="GET, HEAD, POST, PUT, DELETE, PATCH, OPTIONS" modules="FastCgiModule" scriptProcessor="D:Program Files (x86)PHPv7.1php-cgi.exe"
resourceType="Either" requireAccess="Script" />
<remove name="ExtensionlessUrl-Integrated-4.0" />
<add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,DELETE,PUT,PATCH,OPTION" type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

正如你所看到的,我们在那里有mimeMap。我们已经尝试了application/octet流和video/mp4。有人有什么想法吗?我们尝试将web.config放在其他文件夹中,也遇到了同样的问题。

我尝试过的另一件事是进入Kodu并通过那里手动上传文件。它起作用了,但如果你试图访问.mp4,它会显示与我试图通过网站上传时相同的错误。

.mp4文件大小是否大于8MB?如果是这样,则需要增加文件上传大小限制。

创建一个名为.user.ini的文件,其中包含以下内容,并将其放入根目录中。

; Maximum allowed size for uploaded files.
upload_max_filesize = 2048M
; Must be greater than or equal to upload_max_filesize
post_max_size = 2048M

如果文件大小大于30MB,则还需要将其添加到web.config文件中。

<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
<!--Byte in size, increase it to 2GB-->
</requestFiltering>
</security>
</system.webServer>

最新更新