以编程方式将文件上载到ownCloud服务器 [英] Uploading files to an ownCloud server programmatically
问题描述
我正在尝试设置一个Web应用程序,其中许多客户端可以通过Node.js http服务器连接,然后上载/下载文件,然后将显示在不同的显示中。我正在考虑将这些文件存储在可以集成到我的应用程序的免费云服务中。哦,我也在这个项目中使用socket.IO。
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提供了一些API来执行此操作: https://www.dropbox.com/developers 但是我正在研究像ownCloud这样的免费解决方案,我可以拥有更大的存储量并拥有自己的存储空间私人服务器。
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.
推荐答案
@Javier Gonzalez,要上传文件......
@Javier Gonzalez, To upload a file...
错误选项:
curl -X PUT "http://yourserver.com/owncloud/remote.php/webdav/file.zip" -F myfile=@"/Users/Javi/Downloads/file.zip"
For ,上传的文件将包含http标题。
For, the uploaded file will contain the http headers.
更好的选择:
curl -X PUT "http://yourserver.com/owncloud/remote.php/webdav/file.zip" --data-binary @"/Users/Javi/Downloads/file.zip"
或者只使用curl -T文件名网址上传
Or just use curl -T filename url to upload
这篇关于以编程方式将文件上载到ownCloud服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!