以编程方式将文件上传到 ownCloud 服务器 [英] Uploading files to an ownCloud server programmatically

查看:26
本文介绍了以编程方式将文件上传到 ownCloud 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个 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"

因为,上传的文件将包含 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 filename url 上传

Or just use curl -T filename url to upload

这篇关于以编程方式将文件上传到 ownCloud 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆