我们正在尝试获取已附加到本地CouchBase-Lite中的Doc的图像文件。
我希望能够通过使用与CouchDB Remote服务器相同的URL语法来获取此文件。(只指向本地服务器,而不是远程服务器)(http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments)
我似乎能找到如何做到这一点。有人知道怎么做吗?谢谢
发布于 2013-07-22 04:51:14
假设你实际上是在询问Couchbase-Lite (也就是TouchDB )。嵌入式iOS/Android SDK),那么你应该看看这里的http://couchbase.github.io/couchbase-lite-ios/docs/html/interfaceCBLAttachment.html (如果你正在做的话,也可以是安卓的等价物)。
我不知道你为什么还要问URL语法,如果这就是你要做的,所以我不确定这就是你要做的,但嘿-这就是你的答案。如果你在谈论其他事情,你可以澄清。
发布于 2014-04-01 05:40:16
这不是一个真正的答案,因为我也在寻找这个问题的解决方案。我正在使用CBL,我想获得本地数据库的iOS,以便能够从中获取信息。
这就是我到目前为止所知道的:
string[] paths = NSSearchPath.GetDirectories(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomain.User);
var request = new NSMutableUrlRequest();
request.Url = new NSUrl(paths[0], false);
request.HttpMethod = "GET";
var data = NSUrlConnection.SendSynchronousRequest(request, out response, out error);
if(error != null)
{
Console.WriteLine("Error in SendRequest=" + error.LocalizedDescription);
throw new HttpRequestException(error);
}这将在控制台中打印出来: Error in SendRequest=The requested URL in not found on this server。
URL如下所示:
file:///Users/ME/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/ABFDF-ADBAFB-SFGNAFAF/Documents/users/user
https://stackoverflow.com/questions/17535421
复制相似问题