On 27/05/15 19:28, Vincent Petry wrote:
Hi,
I'd recommend not touching the "data" folder directly but doing the move
over WebDAV.
Unfortunately there is no "phpocclient" project yet to make this easier,
but in case you'd be open to rewrite your script in Python you can use
https://github.com/owncloud/pyocclient.
OK maybe using a PHP client I can do this like (unless there is a local
PHP API I can hook into [they are on the same machine]):
include("PEAR/HTTP/WebDAV/Client.php");
$client = new HTTP_WebDAV_Client_Stream();
$user="YOUR_LOGIN";
$pass = "YOUR_PASSWORD";
$dir = "webdav://".$user.":".$pass."@oc.me.com/".$user."/";
$path = "";
var_dump($client->stream_open($dir."test.txt","w",null,$path));
$client->stream_write("HELLO WORLD!");
$client->stream_close();
$client->dir_opendir($dir,array());
var_dump($client->dirfiles);
Because if you move a file directly in "data", the file cache (aka index
in the database, oc_filecache) will not be up to date and the folder
needs to be rescanned (might happen automatically).
But then the file that was moved receives a different file id which is
not the same as the original file, so the client might not recognize the
file as being the same.
OK got it.
I'm not sure whether it's directly related to your reupload problem, but
it is likely that it does.
This sounds like the issue.
Thanks for your help.
Cheers
P
_______________________________________________
User mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/user