Am 31.07.2014 11:12, schrieb Bjoern Schiessle:
On Thu, 31 Jul 2014 10:28:57 +0200 Simeon Ackermann wrote:
i have problems to get the path of a shared file for user b, shared
from user a. To identify the file i have its filedid.
But especially if the file is in a collection (a already shared
folder) i cant find a solution in the API.

If the file was directly shared its easy with:
OCP\Share::getItemSharedWithBySource('file', $itemSource);

But if the file is in shared folder (or subsub...folder) this
function doesnt gives me information about the shared path for user b.

I hope someone has an idea and can help me.
I don't have a direct answer at the moment. But could you give use some
context what you want to achieve? From where do you get the file Id you
want to look up?

Cheers,
Björn
Ok, i will try to explain my point.

For my conversations app a user can send a message and can attach a file. With the javascript function OC.dialogs.filepicker the user gets the filedialog which returns the filepath.
The fileid comes with PHP:

$view = new \OC\Files\View('/' . $userId . '/files');
$fileinfo = $view->getFileInfo($path);

If the file isn't already shared with user or group b i share it with:
\OCP\Share::shareItem('file', $fileId, $share_type, $userId, 17);

To show now the file with iconpreview and downloadlink in the message for user b, i need the correct shared path. If the file was directly shared its easily done with OCP\Share::getItemSharedWithBySource('file', $itemId); But what to do if the file is in a shared folder, e.g. /folder/shared/subfolder/file.txt. For user b the downloadpath should be /shared/subfolder/file.txt

How to get this path the best way is my question.

Greetz
Simeon



_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel

_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel

Reply via email to