代码之家  ›  专栏  ›  技术社区  ›  Silent

蔚蓝色的mp4上传失败

  •  0
  • Silent  · 技术社区  · 8 年前

    我们已经在Azure应用程序服务上设置了一个Laravel项目。我们正在研究上传的能力。mp4文件。如果我们尝试上传。拉链jpg。博士等他们都工作没有失败。这个但mp4文件总是会出错。我们找到的大多数答案都是在网上找到的。但是我们认为它是正确的。以下是一些信息:

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

    我的网络。配置文件位置为: D: \home\site\wwwroot\public\web。配置

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

    <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)\PHP\v7.1\php-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在那里。我们已经尝试了应用程序/八位字节流和视频/mp4。有人有什么想法/想法吗?我们尝试放置web。在其他文件夹中也配置相同的问题。

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

    1 回复  |  直到 8 年前
        1
  •  1
  •   Aaron Chen    8 年前

    是的。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>