dongmijgnnq0118 2017-11-07 15:49
浏览 61
已采纳

Azure .mp4上传失败

Good Morning,

We have setup a Laravel project on an Azure App Service. Were working on the ability to upload .mp4 files. If we try to upload .zip, .jpg, .doc etc they all work without fail. The .mp4 files though always give a error. Most of the answers we've found say its the web.config but we think its correct. Heres some info:

Error we get: 404 Not Found: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

My web.config file location is: D:\home\site\wwwroot\public\web.config

My upload directory is: D:\home\site\wwwroot\public\test

My web.config looks like:

<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>

As you can see we have the mimeMap in there. We've tried both application/octet-stream and video/mp4. Anyone have any thoughts/ideas? We tried placing the web.config in other folders as well with the same issue.

One other thing I tried was going into Kodu and manually uploading the file through there. It worked but if you try to access the .mp4 it shows the same error as when I'm trying to upload through the site.

  • 写回答

1条回答 默认 最新

  • dongtai419309 2017-11-08 02:46
    关注

    Is the .mp4 file size bigger than 8MB? if so, you need to increase file upload size limits.

    Create a file called .user.ini with the following content and place it into your root directory.

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

    If file size bigger than 30MB, you also need to add this to the web.config file.

    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="2147483648" />
          <!--Byte in size, increase it to 2GB-->
        </requestFiltering>
      </security>
    </system.webServer>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭