Uploading Files Over 10MB Times Out

Get help with using the PHP Secure Communications Library.

Moderator: Nuxius

Forum rules
The purpose of this forum is to provide support for phpseclib, a pure PHP SSH / SFTP / RSA library.

Posts by new users are held in a moderation queue and are not publicly visible until the post is approved.

Uploading Files Over 10MB Times Out

Postby swhite » Thu Aug 08, 2013 3:21 pm

I'm creating a form on my website so clients can upload their materials to a secured server. I have the script working but if the files go over around 10MB it just says Login Failed. I'm assuming it's timing out because a 9MB file takes around 15 seconds but anything over 9MB it reaches 16 seconds then it says Login Failed.

I've tried the solutions mentioned in other threads about timing out but none seem to help.

Code: Select all
<?php
include('Net/SFTP.php');
 
$ftp_user_name=$_POST['user'];
 
$ftp_user_pass=$_POST['password'];

$name=$_FILES['userfile']['name'];

$filep=$_FILES['userfile']['tmp_name'];

$sftp = new Net_SFTP('host', 22, 300);
if (!$sftp->login($ftp_user_name, $ftp_user_pass)) {
    exit('Login Failed');
}

$dir = date('Y-m-d-Gis');
   $sftp->mkdir($dir);   
 
// upload the file to the path specified
$upload = $sftp->put('/'.$dir.'/'.$name, $filep, NET_SFTP_LOCAL_FILE);
 

header( "Location: upload-file-ty.php" );


?>
swhite
Traveler
 
Posts: 2
Joined: Thu Aug 08, 2013 3:15 pm

Re: Uploading Files Over 10MB Times Out

Postby TerraFrost » Thu Aug 08, 2013 6:33 pm

If it's saying login "Login Failed" then the problem isn't that the file is too big. At least in-so-far as phpseclib is concerned.

Could be that when you say it's taking 15 seconds to transfer the 9MB file that that 15 seconds is how long it's taking for you to upload it?

Anyway, I'd check out max_execution_time in php.ini. Apache may have a pretty low timeout too.

I'd also be curious as to what your upload_max_filesize and post_max_size were.

Thanks!
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Uploading Files Over 10MB Times Out

Postby swhite » Thu Aug 08, 2013 7:45 pm

Yeah I just needed to upload my max upload size and execution time in php.ini.

Thank you!
swhite
Traveler
 
Posts: 2
Joined: Thu Aug 08, 2013 3:15 pm


Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 1 guest

cron