Closed jancborchardt closed 9 years ago
It would be difficult for me to implement it because need to host local server etc. for be able to test it. Also i'm not exactly sure how ownCloud works.
Server won't be a problem. I offer you a vps with ssh and http. Both on custom ports
You can test with http://demo.owncloud.org :)
I can make a simple app that does the receiving part and giving a url back.
Document here http://doc.owncloud.org/server/7.0/developer_manual/core/ocs-share-api.html lacks greatly i don't know how to implement it. Both login system and uploading.
I guess uploading will be something like http (s):// < user>:< pass > @ owncloud / < pathwhere uploader is > I think @jancborchardt can tell you more.
I tried using custom uploader in http://demo.owncloud.org/ using test:test@ but still it was giving authorization error:
Now i will try to set username/password in headers without use custom uploader.
Also i'm not sure is file form name is "file" or not because documentation not mentions it.
I think you can't write in the demo app. If you need an account, i can give you one.
I can upload in demo app in web site.
I tried this: 9718c5349bb3c183821f6c3f21d31383f8f281cf
But look like that share method for share already uploaded file. So i still can't find where is upload method.
https://github.com/owncloud/mirall This is the repo of the ownCloud client (windows/linux/etc). I don't know any C++ but here is a file that does some 'uploading' https://github.com/owncloud/mirall/blob/4759429702174a6a1ccfc4ab153ab11640f93cce/src/mirall/propagator_legacy.cpp#L223
I don't know C++ too.
@PVince81 @schiesbn can you help with this Share API question?
Now i'm checking webdav: http://www.webdav.org/specs/
Again wall of texts: http://www.webdav.org/specs/rfc4918.html
Try a simple HTTP POST upload to http://host/owncloud/remote.php/webdav/subdirname
Use the same auth.
I tried this: https://dl.dropboxusercontent.com/u/14076298/ShareX/2014/07/aIX6MYY8cX.png
and response was: The remote server returned an error: (404) Not Found. (https://dl.dropboxusercontent.com/u/14076298/ShareX/2014/07/Fi2IIg4XU4.txt)
Looks like you need to use the PUT method instead of POST for upload.
Please also check whether you need an extra "/" at the end if the URL.
Also please remove "owncloud/" from the URL. It was just an example. If owncloud us installed in the root, then the URL is http://myserver/remote.php/webdav/
Using PUT method and URL ends with "/": http://demo.owncloud.org/remote.php/webdav/
Response is: The remote server returned an error: (409) Conflict.
Source code: https://github.com/ShareX/ShareX/blob/master/UploadersLib/FileUploaders/OwnCloud.cs
Good progress ! :smile:
You get 409 because the file with that name already exists on the server.
Maybe try with another file name.
Ideally the uploader could try adding a (2) when getting 409. Not sure what your other uploaders do in such cases.
I forgot to tell you that you need to append the file name in the URL:
Thanks @PVince81 now upload works after add filename to URL.
And it shows up in here too: http://demo.owncloud.org/index.php/apps/files
But when i click image there it not showing preview also don't have thumbnail but i can download it and be able to open it fine, weird.
By the way i didn't noticed you left irc before and was keep writing there to you :P
Edit: Is it intended not having response after successfull upload in webdav? So i can know it is success and then call share api to get URL.
Congratulations!
The preview issue could be a bug on that version of ownCloud. Most important is that if you download the file in the web ui it gives the same content.
After upload you should get a 200 I think, or possibly a WebDAV multi status response code 207 with an XML response that contains a 200.
I left IRC a while ago, sorry.
I gave him access to my dev server running oc 7 RC1. He uploaded something and this was the result (and it worked!)
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message/>
</meta>
<data>
<id>1</id>
<url>http://home.ccc.com:8090/core/public.php?service=files&t=1754d29256954f9d2b7772d6ff9ec714</url>
<token>1754d29256954f9d2b7772d6ff9ec714</token>
</data>
</ocs>
Only the image is corrupted...
Now there is one problem uploaded image becomes corrupt: http://home.brantje.com:8090/core/public.php?service=files&t=a47e03f1b98848121160d60c4234a5e9
Because it contains:
But for last 5-6 years i'm using this same multipart form data request function i wrote for entire uploaders and never uploaded corrupted file before, so I'm not sure what is wrong?
@Jaex since the issue is closed, is there a ShareX build with which to try out ownCloud support? :)
@jancborchardt 3 days ago i was asked is anyone wants setup file in ownCloud IRC channel after see your request in here, i thought you were in channel.
Edit: Removed beta link because not necessary anymore.
@Jaex awesome! :) Looking forward to the release of that.
Supporting ownCloud https://owncloud.org would be cool – it’s a self-hosted data sync platform. It supports WebDAV, so you can support multiple other platforms directly.
In addition you can use the Share API for sharing functionality: http://doc.owncloud.org/server/7.0/developer_manual/core/ocs-share-api.html
cc @brantje