file-transfer

Programmatically transfer images through bluetooth

杀马特。学长 韩版系。学妹 提交于 2019-12-13 00:12:49
问题 How to send a image file from one device to another using bluetooth in Android programmatically. I Can send text files correctly,but when trying to send image files it shows error. Sample code is here: ContentValues values = new ContentValues(); values.put(BluetoothShare.URI, url); values.put(BluetoothShare.DESTINATION, deviceAddress); values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND); Long ts = System.currentTimeMillis(); values.put(BluetoothShare.TIMESTAMP, ts);

Phonegap FileTransfer error code returns null

ε祈祈猫儿з 提交于 2019-12-12 14:23:11
问题 I've been implementing upload picture functionality in Phonegap. My server side code is already ready. Ive installed plugins File and FileTransfer but when i try to upload a picture to my server, the code always fail and will always go to fail() function. I cannot determine whats the error since error.code, error.source, error.target is always null. Why am i getting null on error.code? I cannot determine whats wrong here so i really need your help. This is my code : var pictureSource =

C# copy image form PowerPoint to Word

為{幸葍}努か 提交于 2019-12-12 13:27:42
问题 I need a application to copy text and images form PowerPoint to Word. I use this libraries: Microsoft.Office.Interop.PowerPoint and Microsoft.Office.Interop.Word. The text s easy to transfer, but when I find in PowerPoint a shape containing only a image, it show this error: " A generic error occured GDI+ ", at this part of code: foreach (PowerPoint.Shape shape in slide.Shapes) { if (shape.HasTextFrame != MsoTriState.msoTrue){ shape.Copy(); Image img = (Image)Clipboard.GetData(DataFormats

Python Client Server Transfer .txt Not Writing to File

喜夏-厌秋 提交于 2019-12-12 04:07:54
问题 I'm trying to write a simple client/server in Python using a TCP socket but I can't seem to figure out why the file is not transferring. Client: import socket HOST = '' #server name goes in here PORT = 3820 socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket.connect((HOST,PORT)) fileToSend = open('myUpload.txt', 'rb') while True: data = fileToSend.readline() if data: socket.send(data) else: break fileToSend.close() print 'end' socket.close() exit() The print end is just to tell

PHP File Transfer

我只是一个虾纸丫 提交于 2019-12-12 04:04:37
问题 Suppose I have a device that knows the name of a file they want to download from my server. How can I transfer said file to that device without giving the device access to the file system? For example, suppose I have a page ping.php which receives a get request for "something.zip" ping.php knows the location of something.zip (somewhere on the server's file system), but I can't allow the user access to the file system, or allow them to know the location of the file (it even needs to be hidden

Cordova FIle Transfer plugin how to pass transloadit parameters?

妖精的绣舞 提交于 2019-12-12 03:31:06
问题 Update Trying to post the file to transloadit using the FileTransfer plugin using the following code var uri = encodeURI("https://api2-eu-west-1.transloadit.com/assemblies"); var options = new FileUploadOptions(); options.fileKey = "file"; options.fileName = filepath.substr(filepath.lastIndexOf('/') + 1); var params = new Object(); params.auth =new Object(); params.auth.key ="***************" ; options.params = params; var ft = new FileTransfer(); ft.upload(filepath, uri, win, fail, options);

Transfering raw data to and from PostgreSQL database

笑着哭i 提交于 2019-12-12 02:08:57
问题 So, I've got some generic data in a file. My quest is simple: store that in a field in the database, and retrieve it again later back in to a file. I don't care how it is stored, nor what methods used to transfer it back and forth (but if i can contain it to a plpgsql function or two, that would be an awesome bonus). But it must come back to a file exactly the same as it was entered, bit for bit. I cannot guarantee that it wouldn't contain any special characters, and the data varies in size

Sending file from server to client (python)

回眸只為那壹抹淺笑 提交于 2019-12-12 01:05:42
问题 I'm currently writing a server-client application that need to transfer some file to work. I'm using this method: client: file_to_send = raw_input(">") try: f = open("./sent_files/" + file_to_send, "rb") except IOError, e: print ">error: ", e break data = xmlrpclib.Binary(f.read()) if s.receive_file(file_to_send, data): print ">file correctly sent" server: def receive_file(self, name, arg): with open("./sampletest/"+name, "wb") as handle: handle.write(arg.data) But how can I do the opposite

Sent file has some corrupted data TCP sockets .. how to fix it?

人走茶凉 提交于 2019-12-11 23:31:28
问题 I have problem with my transfer files application .. everything looks great and works the way it should be .. but then I discovered that some pieces of the sent file is corrupted. Like when I send a video file (.MP4) it sent successfully but when I play it some frames of it got corrupted like in the snapshot picture .. I played the source Mp4 file and the picture was so perfect and never looked like in that snapshot picture. So here's my code .. I'm confused now about using fs.Seek .. someone

PHP File Transer - echo breaks things, alternate for debugging?

﹥>﹥吖頭↗ 提交于 2019-12-11 18:07:40
问题 See my other QUESTION. I've successfully set up a simple file transfer, but I've noticed that trying to echo anything on the page corrupts the file, making it unopenable. Here's the code: $filename = $_GET['filename']; $dir = "C:/Users/Me/Desktop/"; $file = realpath($dir . $filename); //echo "$filename</br>$dir</br>$file"; if (file_exists($file)) { header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Content-Type: application/octet-stream'); header('Content