The ftp_fput script can be run locally on the server.

Source: Internet
Author: User
Php cannot be modified because it is a virtual space. INI file: use ftp to upload a large video file to the remote server. The script is as follows: {code ...} the script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server. The php. ini file cannot be modified because it is a virtual space. You can use ftp to upload large video files to the remote server. The script is as follows:

$ Ftp_server = "xxxx.xxxx.com"; $ ftp_user_name = "user"; $ ftp_user_pass = "pass"; $ local_file = "D:/Lyb_0/zmsgx.mp4 "; // local file $ server_file = "htdocs/videos/zmsgx.mp4"; // path of the file to be uploaded $ conn_id = ftp_connect ($ ftp_server ); // connect FTP $ login_result = ftp_login ($ conn_id, $ ftp_user_name, $ ftp_user_pass) or die ("Login error"); // Login $ fp = fopen ($ local_file, "r"); ftp_pasv ($ conn_id, true); // enable passive mode transmission // upload parameter if (ftp_fput ($ conn_id, $ server_file, $ fp, FTP_BINARY )) {echo "Successfully uploaded $ server_file \ n";} else {echo "There was a problem while uploading $ file \ n";} // close the connection ftp_close ($ conn_id ); fclose ($ fp );

The script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server.

Reply content:

The php. ini file cannot be modified because it is a virtual space. You can use ftp to upload large video files to the remote server. The script is as follows:

$ Ftp_server = "xxxx.xxxx.com"; $ ftp_user_name = "user"; $ ftp_user_pass = "pass"; $ local_file = "D:/Lyb_0/zmsgx.mp4 "; // local file $ server_file = "htdocs/videos/zmsgx.mp4"; // path of the file to be uploaded $ conn_id = ftp_connect ($ ftp_server ); // connect FTP $ login_result = ftp_login ($ conn_id, $ ftp_user_name, $ ftp_user_pass) or die ("Login error"); // Login $ fp = fopen ($ local_file, "r"); ftp_pasv ($ conn_id, true); // enable passive mode transmission // upload parameter if (ftp_fput ($ conn_id, $ server_file, $ fp, FTP_BINARY )) {echo "Successfully uploaded $ server_file \ n";} else {echo "There was a problem while uploading $ file \ n";} // close the connection ftp_close ($ conn_id ); fclose ($ fp );

The script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.