Can you upload via curl to anonymous write only workspace?


#1

Is it possible to upload via command line (say using curl) to a Pydio anonymous write only workspace?


#2

Here’s an example of what I mean when I say an anonymous write only workspace.

Can you upload via the API a file using curl to this workspace? I’ve been unable to when trying without a user name and password.


#3

Hi,
so you want to upload to this Dropbox workspace ( correct me if i’m wrong ) using the api but without credentials.
i will ask the devs about it.


#4

Yes precisely. Quite right. Thank you very much.

This works:
curl --upload-file redhat-photo.jpg --user “bob:topsecret” --header “X-File-Name:redhat-photo.jpg” https://files.pydio.com/api/v2/io/my-files/1 > /dev/null

This does not work:
curl --upload-file redhat-photo.jpg --header “X-File-Name:redhat-photo.jpg” https://files.pydio.com/api/v2/io/Dropbox / > /dev/null

But on my workspace configured for anonymous uploads in this case named “Dropbox” , I can’t get the API syntax to work when I leave off the --user “name:password” argument pair from curl.


#5

Hi,
did you take a look over here.


#6

yes @zayn, I did look at that documentation and also at V1 API syntax documentation. But I have not managed to translate that documentation into working syntax unfortunately.


#7

Doesn’t anyone else ever try to upload anonymously to write only workspaces via curl?


#8

Apparently anonymous uploads don’t work via API v2 - only authenticated, one must specify a user name and password. As demonstrated in the shell session below. I’m uploading to a write only workspace.

$ curl --upload-file puppy.png --user “zayn:secretpassword” --header “X-File-Name:puppy.png” https://files.pydio.com/api/v2/io/dropbox/ > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3140 0 635 100 2505 3694 14575 --:–:-- --:–:-- --:–:-- 14649

curl --upload-file puppy.png --header "X-File-Name:puppy.png" https://files.pydio.com/api/v2/io/dropbox/ > /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 2505 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0


#9

Why are my posts being flagged as spam. Two of my responses in this thread are marked as spam with this notice below. I don’t see how any rational community member would consider this spam.

"Your post was flagged as spam: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected.

Multiple community members flagged this post before it was hidden, so please consider how you might revise your post to reflect their feedback."


#10

Hi,
sorry for the spam issue (it’s blocked automatically but i can look at it and remove you from the spam filter ) sorry for the inconvenience ,
as for the API i’m on it i can tell you that the v1 is indeed not working for me i tried :

curl -k --upload-file reddit.png --user "admin:azertyuiop" --header "X-File-Name:reddit-head-api-v1.png" https://localhost:9876/ajaxplorer/api/curl-test-workspace/upload/put/ this one is not working

curl -k --upload-file reddit.png --user "admin:azertyuiop" --header "X-File-Name:reddit-head-api-v2.png" https://localhost:9876/api/v2/io/curl-test-workspace/1 > /dev/null this one is working

curl -k --upload-file reddit.png --header "X-File-Name:reddit_head_anonymous.png" https://localhost:9876/api/v2/io/curl-test-workspace/1 > /dev/null this one is not working

i’m still investigating this, but i believe that it’s not implemented yet in the api.


#11

Thank you very much for the followup Zayn. Yes, I can confirm it doesn’t work in any of the combinations of syntax that I’ve tried either. Would be very helpful if this is supported. I’ve created an issue to track this #1418. https://github.com/pydio/pydio-core/issues/1418