I am trying to set a web application where many clients can connect through a Node.js http server and then upload/download files that will then be shown in different displays. I am thinking about having those files stored in a free cloud service that can be integrated to my app. Oh, and I am also using socket.IO in this project.
Dropbox offers some API to do this: https://www.dropbox.com/developers but I was looking into a free solution like ownCloud where I can have a larger amount of storage and also have my own private server.
Does anyone know if this can be done? or can offer any tips about alternative solutions to my problem? I would really appreciate any help with this since I am quite new to all this.
You have to communicate with the WebDav interface at http://yourowncloudserver.com/owncloud/remote.php/webdav/
To upload a file you have to make a PUT request to the destiny of the file for example: http://yourowncloudserver.com/owncloud/remote.php/webdav/file.zip
And add the input stream to the request to read the file.
Here is the CURL command:
You also can check our code on Objective C to check the parameters that we use: ownCloud iOS Library
As an addition to the existing answers, I use the following function as alias:
Just replace
<username>
,<password>
and<hostname>
and put this in your .bash_aliases and you can upload your files with:The easiest way would be to use the webdav interface of owncloud
Using curl for windows and owncloud 8. The only way I found to transfer a file was by using this command
Hope this helps
Upload a file you have to make a PUT request to the destiny of the file for example: http://yourOwnCloudServer/remote.php/webdav/text.txt
Here is the CURL command:
You can also use
--data-binary
for media files.@Javier Gonzalez, To upload a file...
Bad option:
For, the uploaded file will contain the http headers.
Better option:
Or just use curl -T filename url to upload