2

Is it possible to do file operations from a script running on a different server than the files being operated on? That is, upload, move, rename, delete, create new, modify, etc.

How would I go about doing this?

6 Answers 6

1

As far as I know, it can be done only by logging into the shell via the remote script and then executing the commands from within the shell, or maybe by using FTP from the remote script.

Another method would be:

Create scripts in the server which will accept parametres (POST data) and do operations based on the arguments that are supplied to it.

Sign up to request clarification or add additional context in comments.

4 Comments

I like the scripts method, but is there a way to send data to the scripts without redirecting the browser to them?
You can use a PHP library for requesting and sending data to the scripts.
Please have a look at: http_post_data() - php.net/manual/en/function.http-post-data.php
Since I do not code in PHP, I am not aware of the libraries that suit this purpose. Sorry about that.
1

One way do to it would be through FTP.

1 Comment

That's perfect, and gives me a chance to play with caching. It's also got lots of overhead though -- connecting and disconnecting for every action -- is there a way to at least, say, get the contents of a remote directory? Or does that have to be via FTP also?
0

You are basicallly describing WebDAV, which was created so that write-methods like those found in ftp could be done over HTTP.

I imagine it would be tricky to make a non-http file manager with PHP that was save and reliable.

There are several libraries for adding making WebDAV feasible in PHP, not that are core or standard extensions yet, though.

Comments

0

yes, this is either possible through php’s ftp functions or the native file system functions.

i wrote one myself (myftphp <-- advertisment :D)

using the native filesystem functions there are always restrictions on permission management, but for managing files in a public directory it’s perfect

Comments

0

See http://rosefinch.sf.net

A open source php file manager.

Comments

0

There is a fantastic remote filesystem manager available.

Just have a look at Flysystem.

It requires PHP 5.4 or higher.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.