- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在处理从“Android 聊天”到其他客户端(如 Pidgin)的文件传输时遇到问题:Pidgin 客户端收到传输请求,但我的应用程序无法开始传输文件。
我必须说我已经阅读了所有 stackoverflows 问题,一些 http://community.igniterealtime.org/线程,但所有这些都没有解决我的问题。
为了测试,我在端口 5222 上使用 jabber.org 服务器,并且我使用 Beem-Asmack 库 v7(在某些客户端中,您还必须指定代理:这是必要的吗??)。文件传输代码如下:
public boolean sendFile(final String jid, final String path, String description) {
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(this.xmpp);
/*if (sdm==null) {
sdm = new ServiceDiscoveryManager(this.xmpp);*/
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("http://jabber.org/protocol/disco#item");
sdm.addFeature("jabber:iq:privacy");
//}
Log.d("sending file", "maganer");
FileTransferNegotiator.setServiceEnabled(this.xmpp, true);
FileTransferManager manage = new FileTransferManager(this.xmpp);
Log.d("sending file", "set true");
OutgoingFileTransfer.setResponseTimeout(10000);
OutgoingFileTransfer oft = manage.createOutgoingFileTransfer(this.myRoster.getPresence(jid).getFrom());
try {
Log.d("sending file", "try to send... " + path);
oft.sendFile(new File(path), description);
Log.d("sending file", "Accepted");
while (!oft.isDone()) {
Log.d("status", oft.getStatus().toString());
Log.d("percent", new Long(oft.getBytesSent()).toString());
if (oft.getStatus() == FileTransfer.Status.error) {
Log.e("percent", "Error " + new Long(oft.getBytesSent()).toString() + " " + oft.getError() + " " + oft.getException());
oft.cancel();
return false;
}
//Thread.sleep(1000);
}
} catch (Throwable e) {
e.printStackTrace();
Log.e("sendFile", path);
return false;
}
return true;
}
我还在创建远程服务时执行以下过程
private void startup() {
ProviderManager pm = ProviderManager.getInstance();
// Private Data Storage
pm.addIQProvider("query", "jabber:iq:private",
new PrivateDataManager.PrivateDataIQProvider());
// Time
try {
pm.addIQProvider("query", "jabber:iq:time",
Class.forName("org.jivesoftware.smackx.packet.Time"));
} catch (ClassNotFoundException e) {
Log.w("TestClient",
"Can't load class for org.jivesoftware.smackx.packet.Time");
}
// Roster Exchange
pm.addExtensionProvider("x", "jabber:x:roster",
new RosterExchangeProvider());
// Message Events
pm.addExtensionProvider("x", "jabber:x:event",
new MessageEventProvider());
// Chat State
pm.addExtensionProvider("active",
"http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("composing",
"http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("paused",
"http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("inactive",
"http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("gone",
"http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
// XHTML
pm.addExtensionProvider("html", "http://jabber.org/protocol/xhtml-im",
new XHTMLExtensionProvider());
// Group Chat Invitations
pm.addExtensionProvider("x", "jabber:x:conference",
new GroupChatInvitation.Provider());
// Service Discovery # Items
pm.addIQProvider("query", "http://jabber.org/protocol/disco#items",
new DiscoverItemsProvider());
// Service Discovery # Info
pm.addIQProvider("query", "http://jabber.org/protocol/disco#info",
new DiscoverInfoProvider());
// Data Forms
pm.addExtensionProvider("x", "jabber:x:data", new DataFormProvider());
// MUC User
pm.addExtensionProvider("x", "http://jabber.org/protocol/muc#user",
new MUCUserProvider());
// MUC Admin
pm.addIQProvider("query", "http://jabber.org/protocol/muc#admin",
new MUCAdminProvider());
// MUC Owner
pm.addIQProvider("query", "http://jabber.org/protocol/muc#owner",
new MUCOwnerProvider());
// Delayed Delivery
pm.addExtensionProvider("x", "jabber:x:delay",
new DelayInformationProvider());
// Version
try {
pm.addIQProvider("query", "jabber:iq:version",
Class.forName("org.jivesoftware.smackx.packet.Version"));
} catch (ClassNotFoundException e) {
// Not sure what's happening here.
}
// VCard
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
// Offline Message Requests
pm.addIQProvider("offline", "http://jabber.org/protocol/offline",
new OfflineMessageRequest.Provider());
// Offline Message Indicator
pm.addExtensionProvider("offline",
"http://jabber.org/protocol/offline",
new OfflineMessageInfo.Provider());
// Last Activity
pm.addIQProvider("query", "jabber:iq:last", new LastActivity.Provider());
// User Search
pm.addIQProvider("query", "jabber:iq:search", new UserSearch.Provider());
// SharedGroupsInfo
pm.addIQProvider("sharedgroup",
"http://www.jivesoftware.org/protocol/sharedgroup",
new SharedGroupsInfo.Provider());
// JEP-33: Extended Stanza Addressing
pm.addExtensionProvider("addresses",
"http://jabber.org/protocol/address",
new MultipleAddressesProvider());
// FileTransfer
pm.addIQProvider("si", "http://jabber.org/protocol/si",
new StreamInitiationProvider());
pm.addIQProvider("query", "http://jabber.org/protocol/bytestreams",
new BytestreamsProvider());
pm.addIQProvider("open","http://jabber.org/protocol/ibb",
new IBBProviders.Open());
//
pm.addIQProvider("close","http://jabber.org/protocol/ibb",
new IBBProviders.Close());
//
pm.addExtensionProvider("data","http://jabber.org/protocol/ibb",
new IBBProviders.Data());
//
pm.addExtensionProvider("x","jabber:x:data", new DataFormProvider());
// Privacy
pm.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());
pm.addIQProvider("command", "http://jabber.org/protocol/commands",
new AdHocCommandDataProvider());
pm.addExtensionProvider("malformed-action",
"http://jabber.org/protocol/commands",
new AdHocCommandDataProvider.MalformedActionError());
pm.addExtensionProvider("bad-locale",
"http://jabber.org/protocol/commands",
new AdHocCommandDataProvider.BadLocaleError());
pm.addExtensionProvider("bad-payload",
"http://jabber.org/protocol/commands",
new AdHocCommandDataProvider.BadPayloadError());
pm.addExtensionProvider("bad-sessionid",
"http://jabber.org/protocol/commands",
new AdHocCommandDataProvider.BadSessionIDError());
pm.addExtensionProvider("session-expired",
"http://jabber.org/protocol/commands",
new AdHocCommandDataProvider.SessionExpiredError());
// Private Data Storage
pm.addIQProvider("query","jabber:iq:private", new PrivateDataManager.PrivateDataIQProvider());
// Time
try {
pm.addIQProvider("query","jabber:iq:time", Class.forName("org.jivesoftware.smackx.packet.Time"));
} catch (ClassNotFoundException e) {
Log.w("TestClient", "Can't load class for org.jivesoftware.smackx.packet.Time");
}
// Roster Exchange
pm.addExtensionProvider("x","jabber:x:roster", new RosterExchangeProvider());
// Message Events
pm.addExtensionProvider("x","jabber:x:event", new MessageEventProvider());
// Chat State
pm.addExtensionProvider("active", "http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("paused", "http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("inactive", "http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
pm.addExtensionProvider("gone", "http://jabber.org/protocol/chatstates",
new ChatStateExtension.Provider());
// XHTML
pm.addExtensionProvider("html", "http://jabber.org/protocol/xhtml-im",
new XHTMLExtensionProvider());
// Group Chat Invitations
pm.addExtensionProvider("x", "jabber:x:conference", new GroupChatInvitation.Provider());
// Service Discovery # Items
pm.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
// Service Discovery # Info
pm.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
// Data Forms
pm.addExtensionProvider("x", "jabber:x:data", new DataFormProvider());
// MUC User
pm.addExtensionProvider("x", "http://jabber.org/protocol/muc#user", new MUCUserProvider());
// MUC Admin
pm.addIQProvider("query", "http://jabber.org/protocol/muc#admin", new MUCAdminProvider());
// MUC Owner
pm.addIQProvider("query", "http://jabber.org/protocol/muc#owner", new MUCOwnerProvider());
// Delayed Delivery
pm.addExtensionProvider("x","jabber:x:delay", new DelayInformationProvider());
// Version
try {
pm.addIQProvider("query","jabber:iq:version", Class.forName("org.jivesoftware.smackx.packet.Version"));
} catch (ClassNotFoundException e) {
// Not sure what's happening here.
}
// VCard
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
// Offline Message Requests
pm.addIQProvider("offline", "http://jabber.org/protocol/offline", new OfflineMessageRequest.Provider());
// Offline Message Indicator
pm.addExtensionProvider("offline", "http://jabber.org/protocol/offline", new OfflineMessageInfo.Provider());
// Last Activity
pm.addIQProvider("query", "jabber:iq:last", new LastActivity.Provider());
// User Search
pm.addIQProvider("query", "jabber:iq:search", new UserSearch.Provider());
// SharedGroupsInfo
pm.addIQProvider("sharedgroup", "http://www.jivesoftware.org/protocol/sharedgroup", new SharedGroupsInfo.Provider());
// JEP-33: Extended Stanza Addressing
pm.addExtensionProvider("addresses", "http://jabber.org/protocol/address", new MultipleAddressesProvider());
// FileTransfer
pm.addIQProvider("si", "http://jabber.org/protocol/si", new StreamInitiationProvider());
pm.addIQProvider("query", "http://jabber.org/protocol/bytestreams", new BytestreamsProvider());
pm.addIQProvider("open", "http://jabber.org/protocol/ibb", new IBBProviders.Open());
pm.addIQProvider("close", "http://jabber.org/protocol/ibb", new IBBProviders.Close());
pm.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new IBBProviders.Data());
// Privacy
pm.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());
pm.addIQProvider("command", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider());
pm.addExtensionProvider("malformed-action", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider.MalformedActionError());
pm.addExtensionProvider("bad-locale", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider.BadLocaleError());
pm.addExtensionProvider("bad-payload", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider.BadPayloadError());
pm.addExtensionProvider("bad-sessionid", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider.BadSessionIDError());
pm.addExtensionProvider("session-expired", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider.SessionExpiredError());
}
现在我将描述我的错误:从日志记录中,我收到 -1 作为“百分比”和“协商流”作为“状态”。我不知道我错在哪里以及如何开始传输。感谢您的任何意见或建议。
编辑 (2)现在我已经通过添加部分解决了我的问题
FileTransferNegotiator.IBB_ONLY = true;
在初始化 FileTransferManager 和重新安排 ServiceDiscoveryManager 初始化之前,如下所示:
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(this.xmpp);
if (sdm==null)
sdm = new ServiceDiscoveryManager(this.xmpp);
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("http://jabber.org/protocol/disco#item");
sdm.addFeature("jabber:iq:privacy");
我还在启动时添加了以下配置:
SmackConfiguration.setPacketReplyTimeout(15000);
顺便说一句,现在我达到了与原始文件相同数量的进度值,但文件没有在接收方关闭。因此,会引发超时并中止传输。我如何传达文件的最终确定?似乎我传输了整个文件,即使其他客户端 (Pidgin) 不处理它。再次感谢。
最佳答案
public void send()
{
configureProviderManager(connection);
FileTransferNegotiator.IBB_ONLY = true;
FileTransferNegotiator.setServiceEnabled(connection, true);
FileTransferManager manager = new FileTransferManager(connection);
//OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer("hariom@jabber.ccc.de/Smack");
String to = connection.getRoster().getPresence("hariom@jabber.ccc.de").getFrom();
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(to);
File file = new File("/sdcard/DCIM/Camera/1385869353956.jpg");
try {
Log.d("file sending",file.getAbsolutePath()+" "+file.getName());
configureProviderManager(connection);
transfer.sendFile(file, "test_file");
} catch (XMPPException e) {
e.printStackTrace();
}
while(!transfer.isDone()) {
Log.d("status", transfer.getStatus().toString());
Log.d("percent", new Long(transfer.getBytesSent()).toString());
if (transfer.getStatus() == Status.error) {
Log.e("percent", "Error " + new Long(transfer.getBytesSent()).toString() + " " + transfer.getError() + " " + transfer.getException());
transfer.cancel();
}
if(transfer.getStatus().equals(Status.refused))
System.out.println("refused " + transfer.getError());
else if( transfer.getStatus().equals(Status.error))
System.out.println(" error " + transfer.getError());
else if(transfer.getStatus().equals(Status.cancelled))
System.out.println(" cancelled " + transfer.getError());
else
System.out.println("Success");
}
}
public void configureProviderManager(XMPPConnection connection) {
ProviderManager.getInstance().addIQProvider("query","http://jabber.org/protocol/bytestreams", new BytestreamsProvider());
ProviderManager.getInstance().addIQProvider("query","http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
ProviderManager.getInstance().addIQProvider("query","http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
ProviderManager.getInstance().addIQProvider("query",
"http://jabber.org/protocol/bytestreams",
new BytestreamsProvider());
ProviderManager.getInstance().addIQProvider("query",
"http://jabber.org/protocol/disco#items",
new DiscoverItemsProvider());
ProviderManager.getInstance().addIQProvider("query",
"http://jabber.org/protocol/disco#info",
new DiscoverInfoProvider());
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
if (sdm == null)
sdm = new ServiceDiscoveryManager(connection);
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("http://jabber.org/protocol/disco#item");
sdm.addFeature("jabber:iq:privacy");
ProviderManager pm = ProviderManager.getInstance();
// The order is the same as in the smack.providers file
// Private Data Storage
pm.addIQProvider("query","jabber:iq:private", new PrivateDataManager.PrivateDataIQProvider());
// Time
try {
pm.addIQProvider("query","jabber:iq:time", Class.forName("org.jivesoftware.smackx.packet.Time"));
} catch (ClassNotFoundException e) {
System.err.println("Can't load class for org.jivesoftware.smackx.packet.Time");
}
// Roster Exchange
pm.addExtensionProvider("x","jabber:x:roster", new RosterExchangeProvider());
// Message Events
pm.addExtensionProvider("x","jabber:x:event", new MessageEventProvider());
// Chat State
pm.addExtensionProvider("active","http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("composing","http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("paused","http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("inactive","http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("gone","http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
// XHTML
pm.addExtensionProvider("html","http://jabber.org/protocol/xhtml-im", new XHTMLExtensionProvider());
// Group Chat Invitations
pm.addExtensionProvider("x","jabber:x:conference", new GroupChatInvitation.Provider());
// Service Discovery # Items
pm.addIQProvider("query","http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
// Service Discovery # Info
pm.addIQProvider("query","http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
// Data Forms
pm.addExtensionProvider("x","jabber:x:data", new DataFormProvider());
// MUC User
pm.addExtensionProvider("x","http://jabber.org/protocol/muc#user", new MUCUserProvider());
// MUC Admin
pm.addIQProvider("query","http://jabber.org/protocol/muc#admin", new MUCAdminProvider());
// MUC Owner
pm.addIQProvider("query","http://jabber.org/protocol/muc#owner", new MUCOwnerProvider());
// Delayed Delivery
pm.addExtensionProvider("x","jabber:x:delay", new DelayInformationProvider());
pm.addExtensionProvider("delay", "urn:xmpp:delay", new DelayInformationProvider());
// Version
try {
pm.addIQProvider("query","jabber:iq:version", Class.forName("org.jivesoftware.smackx.packet.Version"));
} catch (ClassNotFoundException e) {
System.err.println("Can't load class for org.jivesoftware.smackx.packet.Version");
}
// VCard
pm.addIQProvider("vCard","vcard-temp", new VCardProvider());
// Offline Message Requests
pm.addIQProvider("offline","http://jabber.org/protocol/offline", new OfflineMessageRequest.Provider());
// Offline Message Indicator
pm.addExtensionProvider("offline","http://jabber.org/protocol/offline", new OfflineMessageInfo.Provider());
// Last Activity
pm.addIQProvider("query","jabber:iq:last", new LastActivity.Provider());
// User Search
pm.addIQProvider("query","jabber:iq:search", new UserSearch.Provider());
// SharedGroupsInfo
pm.addIQProvider("sharedgroup","http://www.jivesoftware.org/protocol/sharedgroup", new SharedGroupsInfo.Provider());
// JEP-33: Extended Stanza Addressing
pm.addExtensionProvider("addresses","http://jabber.org/protocol/address", new MultipleAddressesProvider());
// FileTransfer
pm.addIQProvider("si","http://jabber.org/protocol/si", new StreamInitiationProvider());
pm.addIQProvider("query","http://jabber.org/protocol/bytestreams", new BytestreamsProvider());
pm.addIQProvider("open","http://jabber.org/protocol/ibb", new OpenIQProvider());
pm.addIQProvider("data","http://jabber.org/protocol/ibb", new DataPacketProvider());
pm.addIQProvider("close","http://jabber.org/protocol/ibb", new CloseIQProvider());
pm.addExtensionProvider("data","http://jabber.org/protocol/ibb", new DataPacketProvider());
// Privacy
pm.addIQProvider("query","jabber:iq:privacy", new PrivacyProvider());
// SHIM
pm.addExtensionProvider("headers", "http://jabber.org/protocol/shim", new HeadersProvider());
pm.addExtensionProvider("header", "http://jabber.org/protocol/shim", new HeaderProvider());
// PubSub
pm.addIQProvider("pubsub", "http://jabber.org/protocol/pubsub", new PubSubProvider());
pm.addExtensionProvider("create", "http://jabber.org/protocol/pubsub", new SimpleNodeProvider());
pm.addExtensionProvider("items", "http://jabber.org/protocol/pubsub", new ItemsProvider());
pm.addExtensionProvider("item", "http://jabber.org/protocol/pubsub", new ItemProvider());
pm.addExtensionProvider("subscriptions", "http://jabber.org/protocol/pubsub", new SubscriptionsProvider());
pm.addExtensionProvider("subscription", "http://jabber.org/protocol/pubsub", new SubscriptionProvider());
pm.addExtensionProvider("affiliations", "http://jabber.org/protocol/pubsub", new AffiliationsProvider());
pm.addExtensionProvider("affiliation", "http://jabber.org/protocol/pubsub", new AffiliationProvider());
pm.addExtensionProvider("options", "http://jabber.org/protocol/pubsub", new FormNodeProvider());
// PubSub owner
pm.addIQProvider("pubsub", "http://jabber.org/protocol/pubsub#owner", new PubSubProvider());
pm.addExtensionProvider("configure", "http://jabber.org/protocol/pubsub#owner", new FormNodeProvider());
pm.addExtensionProvider("default", "http://jabber.org/protocol/pubsub#owner", new FormNodeProvider());
// PubSub event
pm.addExtensionProvider("event", "http://jabber.org/protocol/pubsub#event", new EventProvider());
pm.addExtensionProvider("configuration", "http://jabber.org/protocol/pubsub#event", new ConfigEventProvider());
pm.addExtensionProvider("delete", "http://jabber.org/protocol/pubsub#event", new SimpleNodeProvider());
pm.addExtensionProvider("options", "http://jabber.org/protocol/pubsub#event", new FormNodeProvider());
pm.addExtensionProvider("items", "http://jabber.org/protocol/pubsub#event", new ItemsProvider());
pm.addExtensionProvider("item", "http://jabber.org/protocol/pubsub#event", new ItemProvider());
pm.addExtensionProvider("retract", "http://jabber.org/protocol/pubsub#event", new RetractEventProvider());
pm.addExtensionProvider("purge", "http://jabber.org/protocol/pubsub#event", new SimpleNodeProvider());
// Nick Exchange
pm.addExtensionProvider("nick", "http://jabber.org/protocol/nick", new Nick.Provider());
// Attention
pm.addExtensionProvider("attention", "urn:xmpp:attention:0", new AttentionExtension.Provider());
//input
pm.addIQProvider("si", "http://jabber.org/protocol/si",
new StreamInitiationProvider());
pm.addIQProvider("query", "http://jabber.org/protocol/bytestreams",
new BytestreamsProvider());
pm.addIQProvider("open", "http://jabber.org/protocol/ibb",
new OpenIQProvider());
pm.addIQProvider("close", "http://jabber.org/protocol/ibb",
new CloseIQProvider());
pm.addExtensionProvider("data", "http://jabber.org/protocol/ibb",
new DataPacketProvider());
}
关于java - 无法使用 Beem-Asmack 在 XMPP FileTransfer 中处理上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10457569/
在我的 Ionic 2 应用程序中,我使用 cordova-plugin-camera 拍照,通过 FILE_URL (本地设备的图像位置)检索图片,效果很好. 这给了我用相机拍照时的 URL:fil
我的设置是:Django 1.3/Python 2.7.2/Win Server 2008 R2/IIS 7.5/MS SQL Server 2008 R2。我正在开发一个应用程序,其主要功能是分析上
我正在尝试通过 cordova filetransfer 获取下载的文件,以便其他 native 应用程序(例如 android 上的下载应用程序)可以访问。 我正在获取/sdcard/Downloa
我有一个简单的混合应用程序,它应该使用 cordova 2.3.0 下载文件。来自文档: var filePath = someFullPath; //e.g. "file:///mnt/sdcard
我一整天都被这个问题困扰着,JavaScipt 代码看起来不错。但是在输出中我得到了这个: 2012-09-25 15:09:57.584 ViviJesolo[13863:c07] File Tra
因此,在修改了一段时间之后,我注意到 upload() 函数至少会抛出最基本的错误,即使给定的上传目的地完全是假的。但是,如果域中的任何地方都有 UNDERSCORE(具体来说,我需要上传到 dev_
我正在使用 Cordova (5.4) 为 Android 和 Iphone 创建应用程序。一切顺利,除了我想使用 Cordova 的插件“FileTransfer”下载图像,而且路径有一些问题。 如
我正在发送通过 Cordova 的 MediaCapture plugin 录制的视频通过 FileTransfer plugin 到远程服务器,但没有任何东西——无论是文件还是任何数据——都没有到达
我一直在 Phonegap 中实现上传图片功能。我的服务器端代码已经准备就绪。 我已经安装了 File 和 FileTransfer 插件,但是当我尝试将图片上传到我的服务器时,代码总是失败,并且总是
我收到以下错误: ReferenceError: FileTransfer is not defined 当我尝试创建一个新实例时: var ft = new FileTransfer
我在使用 Cordova 中的 FileTransfer 方法时遇到问题。该功能之前可以工作,但现在我已经切换了托管提供商,并且我使用选项对象发送的参数不起作用。我使用的上传代码是; $scope.u
我正在尝试使用 FileTransfer Cordova 插件 ( https://github.com/apache/cordova-plugin-file-transfer ) 的上传方法上传文件
我尝试使用 cordova FileTransfert 发送自定义 header ,但是当我检查 PHP 函数 getAllHeader() 时,“我找不到我的自定义 header 。 var opt
我正在使用 Cordova FileTransfer 对象将文件从 url 下载到设备。 var fileTransfer = new FileTransfer(); var path = cordo
在 angular/ionic 应用程序中,我有以下代码可以从互联网下载 pdf。 public pdfDownload(){ const fileTransfer: FileTran
我今天刚刚从 Cordova (PhoneGap) 1.5 升级到 1.9,突然我的 FileTransfer 参数停止发布。我可以说出来,因为我让服务器端调试了 $_POST 参数,它们现在是空白的
我正在使用 jquerymobile/phonegap/cordova(2.0) 开发移动应用程序。我尝试从流 (xml) 下载一些文件并将它们存储在本地。此行为仅出现在我用于调试的 chrome 浏
我正在进行相当简单的文件传输,应该从 AWS 下载文件并将其存储到设备上。虽然这似乎适用于 JPEG 文件,但它在 PDF 和 PNG 上失败,并显示错误,仅显示无法创建目标文件。 同时创建了一堆其他
我正在尝试使用 FileTransfer method 将文件从 PhoneGap 上传到服务器。我需要为此上传启用 HTTP 基本身份验证。 相关代码如下: var options = ne
我正在使用 cordovaFileTransfer 插件。使用下面的代码,我还将选项变量发送到我的 upload.php 文件。 var options = { fileKey: "file",
我是一名优秀的程序员,十分优秀!