Inquisitive's avatar

Unable to upload large file around 70MB on server

Everything works fine on local, but when I tried to upload a file to the server, it takes some time and shows the following error:

This site can’t be reached The connection was reset. Try:

Checking the connection Checking the proxy and the firewall Running Windows Network Diagnostics ERR_CONNECTION_RESET

Currently, my code looks like:

    $extension = $request->file('import_file')->getClientOriginalExtension(); // getting excel extension
    $dir = 'assets/files/contribution_data/';
    $filename = uniqid().'_'.time().'_'.date('Ymd').'.'.$extension;
    $request->file('import_file')->move($dir, $filename);

What might I be doing wrong here? How can I get rid of this problem?

0 likes
2 replies
amk's avatar

Have you changed php.ini.....

Snapey's avatar

Allocate plenty of memory to the server

increase the script execution time

increase the maximum upload size

increase the max post size

You will need to be able to edit the php.ini file on your server to do this.

Please or to participate in this conversation.