file-transfer

How can I transfer a file via XMPP using Python?

China☆狼群 提交于 2019-12-22 11:30:15
问题 I'm using xmpppy library for my jabber remote administration bot, but I can't find how to send/receive a file and save it inside the directory specified. The documentation is poor and there isn't any examples, but I really want to make it. Can anyone show some examples or some links about it? Or maybe I should use an alternative xmpp bindings? 回答1: There are two XEP's (XMPP Extensions) that cover file transfer: XEP-0096 http://xmpp.org/extensions/xep-0096.html (called SI (Stream Initiated)

Getting total file length when using chunked http transfers

妖精的绣舞 提交于 2019-12-22 01:09:11
问题 I've written a program in Java to use chunking to download large files over http. Everything is working fine but I'd like to add a progress bar which I can't do unless I get the total length of the file. Is there any way to do this? 回答1: If the server provides a Content-Length header field, then that's easy. If it doesn't, then you're out of luck. Reasonable server implementations provide Content-Length when the content is static and has a known size. If the content is dynamically generated,

Download file in ios for ionic 3 not showing in files folder

≯℡__Kan透↙ 提交于 2019-12-22 00:12:37
问题 ionic 3 I am using #cordova-plugin-file-transfer, to download the file from url in android and ios. For Android it is working fine. But for ios app, i am facing a problem. The file is downloading successfully, but i am not able to see downloaded file on ios device. Here is my code for ios => const transfer = this.transfer.create(); transfer.download(url, cordova.file.documentsDirectory + fileName).then( entry => { console.log(entry); this.apiService.showError("Download Succeeded."); this

Finding file type of NSData recieved from server

只谈情不闲聊 提交于 2019-12-21 21:50:38
问题 I am receiving a text file from a socket over TCP/IP. There is no file extension (or filename for that matter) as the data is received as bytes. I can take the data from this (in the form of NSData) and load it into a UITextView and display it fine. I want to persist this data to a file. However, I don't know what format the data is in (txt, rtf, doc, docx)? I assume it as .txt and save it in the documents directory, but is there a programmatic way of finding out for sure? I've looked around

Send File From Python Server to Java Client

点点圈 提交于 2019-12-21 06:48:11
问题 I am trying to send files from a Python server to Java client over a TCP socket. Here is what I have so far: Java Client (Note that all of the file transfer code is in the getFile() method): public class Client1 { private Socket socket = null; private FileOutputStream fos = null; private DataInputStream din = null; private PrintStream pout = null; private Scanner scan = null; public Client1(InetAddress address, int port) throws IOException { System.out.println("Initializing Client"); socket =

rsync error: failed to set times on “/foo/bar”: Operation not permitted

拈花ヽ惹草 提交于 2019-12-20 07:58:22
问题 I'm getting a confusing error from rsync and the initial things I'm finding from web searches (as well as all the usual chmod'ing) are not solving it: rsync: failed to set times on "/foo/bar": Operation not permitted (1) rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-35.2/rsync/main.c(992) [sender=2.6.9] It seems to be working despite that error, but it would be nice to get rid of that. 回答1: If /foo/bar is on NFS (or possibly some FUSE filesystem), that

File download fails over https in IE

一笑奈何 提交于 2019-12-20 06:37:03
问题 I'm trying to download a file over HTTPS & it fails in IE but works perfectly with Firefox & Chrome: aspx code is as follows: <%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CRISIIWebApplication1.Default" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:TextBox ID=

How to transfer pictures from android device to Matlab and vice-versa

元气小坏坏 提交于 2019-12-19 10:52:31
问题 I am in trouble and need your help. I am currently working on a project which requires me to first capture a natural scene(picture) using an android device, extract text and then recognize the text. I have already achieved the process of extraction and recognizing through Matlab. Now my problem is, how can i transfer a picture which is captured from my android cell phone to MATLAB? How to send the results back to the phone after processing the image? Please help. A code will be appreciated.

Transfer file from one ios device to another using wifi and 3G network?

左心房为你撑大大i 提交于 2019-12-19 04:55:28
问题 I am just curious to learn if I can send file from one ios device to another using wifi or 3G network. I am not sure this is possible or not. I gone through apple's documentation of CFNetwork reference and I found cfftp reference. I am not able to understand it clearly as it is saying that we can implement read stream from remote server. I want to read file from one device to another device and write the same using wifi of both devices same as the way we can do using Bluetooth . Is it

python socket file transfer

时光怂恿深爱的人放手 提交于 2019-12-18 12:26:40
问题 I'm trying to write transfer files or chunks of data over a socket. I feel as if I'm reinventing the wheel, but my searches for a simple solution have failed (everything I find is either too simple or too complex). The server would run on a phone running python 2.5.4. The intended application would be to sync music files between the phone and a host computer. This is the guts of what I have, which appears to work. I send and receive 'ok' to break up streams. Is sending 'ok' back and forth