file-transfer

Android WebRTC DataChannel binary transfer mode

佐手、 提交于 2019-12-06 13:38:47
问题 I achieved to transfer data between two android phones using WebRTC's DataChannel : On one side, I send the data: boolean isBinaryFile = false; File file = new File(path); // let's assume path is a .whatever file's path (txt, jpg, pdf..) ByteBuffer byteBuffer = ByteBuffer.wrap(convertFileToByteArray(file)); DataChannel.Buffer buf = new DataChannel.Buffer(byteBuffer, isBinaryFile); dataChannel.send(buf); On the other side, this callback should be called regardless of isBinaryFile value :

Video Tag Local File Download Cordova Android

走远了吗. 提交于 2019-12-06 12:23:09
问题 I'm trying to download a video and then play it using apache Cordova 3.4.0, but I don't know if I can use the video tag. There are some plugins that work for using the video tag like Html5Video but it needs the video file to be present in the app folder. There are other plugins that use other players and load the file using the file path, but since the file download now uses Html5 urls, and the fullPath gives me a realitive path to the file system, it's really impossible to know where the

XMPPFramework - TURNSocket can't receive the data that sent by myself?

扶醉桌前 提交于 2019-12-06 11:04:36
问题 I used the openfire as the xmpp server, and want to transfer file via the Turnsocket. The openfire (local) config: xmpp.auth.anonymous true xmpp.domain local xmpp.enabled true xmpp.externalip proxy.local, 192.168.1.101, 127.0.0.1 xmpp.proxy.enabled true xmpp.proxy.port 7777 xmpp.proxy.transfer.required false xmpp.server.socket.active true xmpp.session.conflict.limit 0 xmpp.socket.ssl.active true I tested the file transfer in the local environment, one user is logged in by Simulator (Sender),

Zf2 file upload by jQuery File Upload - file was not found

馋奶兔 提交于 2019-12-06 11:00:49
when I use jQuery File Upload I have error during ajax upload. In controller: $adapter = new \Zend\File\Transfer\Adapter\Http(); $adapter->isValid(); or $adapter->receive(); Both methotds returns "File [file name] was not found" dump from $_FILES: Array ( [files] => Array ( [name] => Penguins.jpg [type] => image/jpeg [tmp_name] => /tmp/phpwQoG2L [error] => 0 [size] => 777835 ) ) If I use move_uploaded_file in the same place all works ZF2 v2.2.4 What is wrong? 来源: https://stackoverflow.com/questions/19616982/zf2-file-upload-by-jquery-file-upload-file-was-not-found

Is it possible to send file from android smart phone to computer / PC programmatically?

被刻印的时光 ゝ 提交于 2019-12-06 09:28:38
问题 I have tried to find a information/way about this case and I found 3 ways to do this, there is : using adb usb host usb accessory but, I'm still not found the solution. anybody can help me about this case? 回答1: you can use socket: Server side: import java.io.*; import java.net.*; public class FileServer { public static void main(String[] args) throws IOException { int filesize=6022386; // filesize temporary hardcoded long start = System.currentTimeMillis(); int bytesRead; int current = 0; //

XMODEM for python

夙愿已清 提交于 2019-12-06 06:29:30
I am writing a program that requires the use of XMODEM to transfer data from a sensor device. I'd like to avoid having to write my own XMODEM code, so I was wondering if anyone knew if there was a python XMODEM module available anywhere? def xmodem_send(serial, file): t, anim = 0, '|/-\\' serial.setTimeout(1) while 1: if serial.read(1) != NAK: t = t + 1 print anim[t%len(anim)],'\r', if t == 60 : return False else: break p = 1 s = file.read(128) while s: s = s + '\xFF'*(128 - len(s)) chk = 0 for c in s: chk+=ord(c) while 1: serial.write(SOH) serial.write(chr(p)) serial.write(chr(255 - p))

Netty: How to handle received chunks from a ChunkedFile

爱⌒轻易说出口 提交于 2019-12-06 06:09:45
I am new to netty and I am attempting to transfer a chunkedfile from a server to a client. Sending the chunks work just fine. The problem is on how to handle the received chunks and write them to a file. Both methods that I tried give me a direct buffer error. Any help would be greatly appreciated. Thanks! @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { System.out.println(in.toString()); //METHOD 1: write to file FileOutputStream fos = new FileOutputStream("c:\\test.txt"); fos.write(in.array()); //METHOD 2: getting desperate /

AWS S3 signed url encode resulting “SignatureDoesNotMatch”

跟風遠走 提交于 2019-12-06 05:57:39
问题 I am using cordova file transfer to dowload a file from aws s3 using signed url, since cordova filetransfer encodes the uri, the "%" in signature is converted to "%25", thus, results in signature mismatch 回答1: Try setting up your options like so: options = { fileKey: 'file', fileName: name, chunkedMode: false, mimeType: 'audio/3gpp', httpMethod: 'PUT', // Important! headers: { 'Content-Type': 'audio/3gpp' // < Set explicitly otherwise it becomes multipart/form-data which won't work with S3 },

Sending Pictures like WhatsApp

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 04:36:10
问题 I have made a chatting application. I want to add photo/file sharing concept in my application same as WhatsApp. I have made the app using Xmpp/Openfire and current now I am using this function for photo sharing, but it is not all reliable : public void sendFile(final String path, final String receiver) { Thread thread = new Thread() { public void run() { ServiceDiscoveryManager sdm = ServiceDiscoveryManager .getInstanceFor(connection); if (sdm == null) sdm = new ServiceDiscoveryManager

C- Socket : Programming a Client/Server-Application to send a file

折月煮酒 提交于 2019-12-06 03:56:48
I want to program an application to send a file with sockets: Here my Server: void str_server(int sock) { char buf[1025]; const char* filename="test.text"; FILE *file = fopen(filename, "rb"); err_abort("Test"); while (!feof(file)) { int rval = fread(buf, 1, sizeof(buf), file); send(sock, buf, rval, 0); } } and here my client: void RecvFile(int sock, const char* filename) { int rval; char buf[0x1000]; FILE *file = fopen(filename, "wb"); while ((rval = recv(sock, buf, sizeof(buf), 0)) > 0) { fwrite(buf, 1, rval, file); } close(sock); } My problem is that my client create a file....but dont write