File upload in php to another server [closed]

-1

Uploading heavy files to another server using PHP

Send files from Autocad, and these files are heavy ... wanted to know if you have how to enter the site, in the sector to send these files, that is, will have a form where the user will send this file and will send to a server within the company.

    
asked by anonymous 09.06.2014 / 15:43

1 answer

1

You can use the ftp_put function if you want to FTP these files.

<?php
$file = 'somefile.txt';
$remote_file = 'readme.txt';

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
 echo "successfully uploaded $file\n";
} else {
 echo "There was a problem while uploading $file\n";
}

// close the connection
ftp_close($conn_id);
?>

Source: PHP Manual available at link

As heavy files, consider using ajax in your requests and the set_time_limit function on the server side.

    
09.06.2014 / 16:03