简体   繁体   中英

Upload files on file server in intranet in php

I am maintaining two local servers on local network (within the office premises).

One is the server where my php files are being located and another server is a File Server where I want to store all the uploaded files. As the second one is a file server so there should no need to install php on that server.

How I can upload the files to another server. I have the full rights to access the file server. I tried to use ftp_connect() method. But that is not working in Intranet however, it is perfectly working with any live server ftp credentials.

If I use CURL then I have to install PHP on my file server, but that is not a good practice. So how I can upload the files using php ftp related methods?

How I can upload the files to file server. Thanks in advance.

Since in your case both client and server are Unix systems, the easiest is to mount a directory of the file server on the web server by NFS. This way you can upload files by copying or moving them locally, no need to muck around with FTP or SSH modules in PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM