如何将超过1GB的文件上传到Godaddy

时间:2019-05-21 16:24:23

标签: post laravel-5 https server godaddy-api

我使用laravel创建了一个API,用于将电影上传到Godaddy的服务器 最大max_post_size为128mb,我想上传大于1GB的视频, 我该怎么办?

我尝试从php.ini中更改max_post_size,但仅需128mb。

     * @param  \Closure  $next
     * @return mixed
     *
     * @throws \Illuminate\Http\Exceptions\PostTooLargeException
     */
    public function handle($request, Closure $next)
    {
        $max = $this->getPostMaxSize();

        if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
            **throw new PostTooLargeException;**
        }

        return $next($request);
    }

    /**
     * Determine the server 'post_max_size' as bytes.
     *
     * @return int
     */
    protected function getPostMaxSize()
    {
        if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
            return (int) $postMaxSize;
        }

1 个答案:

答案 0 :(得分:0)

我刚刚意识到Godaddy和其他共享主机并没有给您免费空间来存储您的大文件,您需要一个VPS(虚拟专用服务器),并且可以像https://www.vpsserver.com/一样在线获取它< / p>

相关问题