Search code examples
postlaravel-5httpsservergodaddy-api

How to upload files more than 1GB to godaddy


I have created an API with laravel for uploading movies to Godaddy's server the maximum max_post_size is 128mb and I want to upload videos more than 1GB size, what should I do?

I tried changing the max_post_size from php.ini but nothing more than 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;
        }

Solution

  • I just realized that Godaddy and other shared hosts don't give you a free space to store your high_sized files, You need a VPS(Virtual Private Server) for that and you can get it online like https://www.vpsserver.com/