Hi, I'm looking in to using owncloud as a remote backed for file
syncing in stackedit [1]. i.e. not a hosted app on owncloud.
I'm working on a local host ATM runnig owncloud & stackedit to get
around CORS. (Bug opened by Jan-Christoph)
I can get the shares list using JS by simply doing:
$.ajax({
url: server + '/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json',
dataType: "json",
username: user,
password: pass,
timeout: constants.AJAX_TIMEOUT
})
And then call it again with ''&shared_with_me=true' to get the other shares.
So that's all good, I just need to make it look pretty so the user can
select what to import in to stackedit.
However, what I can't seem to do is download the files :(
Testing this on one shared file in the root directory.
var download_uri = '/index.php/apps/files/ajax/download.php?dir=/&files='
$.ajax({
url: server + download_uri + file,
username: user,
password: pass,
timeout: constants.AJAX_TIMEOUT
})
This gets me what appears to be the login page, every time :(
I've also tried:
var download_uri = '/index.php/apps/files_texteditor/ajax/loadfile.php?file=';
With this I get:
{"data":{"message":"Authentication
error","error":"authentication_error"},"status":"error"}
I'm pretty sure it can't be user/password as they are required to get
the shares list in the first place.
Is there a way to d/l the shared files using ajax?
Cheers, Jeff.
_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel