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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题