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

问题描述

我试图设置一个Web应用程序,许多客户端可以通过一个Node.js http服务器连接,然后上传/下载文件,然后将显示在不同的显示器上。我正在考虑将这些文件存储在可以集成到我的应用程序的免费云服务中。哦,我也在这个项目中使用socket.IO。
$ b Dropbox提供了一些API来执行此操作:

有谁知道这是否可以做到?或者可以提供关于我的问题的替代解决方案的任何提示我真的很感激任何帮助,因为我对这一切都很陌生。

谢谢!!!

@Javier Gonzalez,To上传一个文件...

不好的选项:

$ $ p $ curl - X PUThttp://yourserver.com/owncloud/remote.php/webdav/file.zip-F myfile = @/ Users / Javi / Downloads / file.zip

因为上传的文件将包含http头文件。



更好的选项: p>

  curl -X PUThttp://yourserver.com/owncloud/remote.php/webdav/file.zip--data -binary @/ Users / Javi / Downloads / file.zip

或者使用curl -T要上传的文件名url


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.

Thank you!!!

解决方案

@Javier Gonzalez, To upload a file...

Bad option:

curl -X PUT "http://yourserver.com/owncloud/remote.php/webdav/file.zip" -F myfile=@"/Users/Javi/Downloads/file.zip"

For, the uploaded file will contain the http headers.

Better option:

curl -X PUT "http://yourserver.com/owncloud/remote.php/webdav/file.zip" --data-binary @"/Users/Javi/Downloads/file.zip"

Or just use curl -T filename url to upload

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

08-27 16:14