upload

Phonegap's FileTransfer.upload() throwing error code 3 on Android

这一生的挚爱 提交于 2019-11-30 07:02:30
问题 I am working on uploading a picture to a server. I am able to successfully upload an image using iOS but when i try on android I get the error code 3. Currently using phonegap cordova 1.8.1. I already tried adding true to the parameters upload(filePath, server, successCallback, errorCallback, options, **true**); and adding this options.chunkedMode = false; My AndroidManifest file contains: <uses-permission android:name="android.permission.INTERNET" /> My cordova.xml file contains: <access

php resizing image on upload rotates the image when i don't want it to

橙三吉。 提交于 2019-11-30 07:01:21
问题 I Have an upload script that resizes the images uploaded, however, some images are being saved as a rotated image when i dont want them to, any way to preserve the original image direction? if (($resizeObj->width > 400) || ($resizeObj->height > 600)){ // *** 2) Resize image (options: exact, portrait, landscape, auto, crop) $resizeObj -> resizeImage(400, 400, 'crop'); // *** 3) Save image $resizeObj -> saveImage($path, 95); } this is my class file: <?php # =====================================

Choose image from gallery and camera through web view is not working in Android 6.0 Marshmallow

倖福魔咒の 提交于 2019-11-30 07:00:59
问题 Here is my code. I am using WebView for registration purposes. In the registration process I have to upload an image from the device. I have finished the code for this and it is working properly in every Android version except Marshmallow. I have given all necessary permissions from the manifest. The code: public class WebViewActivity extends Activity { private static final int INPUT_FILE_REQUEST_CODE = 1; private static final int FILECHOOSER_RESULTCODE = 1; private static final String TAG =

How to test file upload in Laravel 5.2

二次信任 提交于 2019-11-30 06:19:31
问题 Im trying to test an upload API but it fails every time: Test Code : $JSONResponse = $this->call('POST', '/upload', [], [], [ 'photo' => new UploadedFile(base_path('public/uploads/test') . '/34610974.jpg', '34610974.jpg') ]); $this->assertResponseOk(); $this->seeJsonStructure(['name']); $response = json_decode($JSONResponse); $this->assertTrue(file_exists(base_path('public/uploads') . '/' . $response['name'])); file path is /public/uploads/test/34610974.jpg Here is My Upload code in a

Retrofit 2 file down/upload

纵然是瞬间 提交于 2019-11-30 06:17:36
问题 I'm trying to down/upload a file with retrofit 2 but can't find any tutorials examples on how to do so. My code for downloading is: @GET("documents/checkout") public Call<File> checkout(@Query(value = "documentUrl") String documentUrl, @Query(value = "accessToken") String accessToken, @Query(value = "readOnly") boolean readOnly); and Call<File> call = RetrofitSingleton.getInstance(serverAddress) .checkout(document.getContentUrl(), apiToken, readOnly[i]); call.enqueue(new Callback<File>() {

change button text in js/ajax after mp4 =>mp3 conversion in php

时光总嘲笑我的痴心妄想 提交于 2019-11-30 06:06:59
问题 I am working on html table rows (which is two at this moment) as shown below in which on button click: => JS/jQuery code is called (where Go text changes to Converting ) => and then convert.php script through AJAX where conversion of mp4 into mp3 happens. html/php code: <?php foreach ($programs as $key => $program) { ?> <tr data-index="<?php echo $key; ?>"> <td><input type="submit" id="go-btn" name="go-button" value="Go" data-id="<?php echo $key; ?>" ></input></td> </tr> <?php }?> convert.php

how to upload an audio file using HTTP POST from iPhone?

一世执手 提交于 2019-11-30 05:32:32
I am trying to upload an audio file in "caf" format from the iPhone to a web server. The used codes are given below. The problem is, I am not getting any file to upload, there is not output for the file names in PHP echo ! Any help would be greatly appreciated. The code I am using at the iPhone end is: NSData *fileData=[NSData dataWithContentsOfURL:recordedTmpFile]; NSURL *url=[NSURL URLWithString:@"http://somelink.com/upload.php"]; NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"POST"]; NSString *boundary = [NSString stringWithString:@"---------

Upload Laravel 5 to server subfolder

风流意气都作罢 提交于 2019-11-30 05:29:44
I am trying to upload Laravel 5 project to subfolder as: public_html/project/ I have changed in index.php require __DIR__.'/../project/bootstrap/autoload.php'; $app = require_once __DIR__.'/../project/bootstrap/app.php'; in config/app.php 'url' => 'http://example.com/project', when I try url as: http://example.com/project/public it is directed to http://example.com/public What is the way to upload it to server. Can anyone help me as I have tried lot options. It is not a good idea to upload your entire laravel project in the public_html (public)folder. The files in the public folder are having

Streaming data of unknown size from client to server over HTTP in Python

♀尐吖头ヾ 提交于 2019-11-30 05:29:11
As unfortunately my previous question got closed for being an "exact copy" of a question while it definitely IS NOT, hereby again. It is NOT a duplicate of Python: HTTP Post a large file with streaming That one deals with streaming a big file; I want to send arbitrary chunks of a file one by one to the same http connection. So I have a file of say 20 MB, and what I want to do is open an HTTP connection, then send 1 MB, send another 1 MB, etc, until it's complete. Using the same connection, so the server sees a 20 MB chunk appear over that connection. Mmapping a file is what I ALSO intend to do

how to preview an image before upload in various browsers

柔情痞子 提交于 2019-11-30 05:24:24
I want to show preview of an image before it is uploaded. I have found a partial solution that works for ie6 and firefox, and havent yet tested it in ie7 or ie8. But i want a solution that works in safari, ie7 and ie8 as well. Here is the solution obtained by combining the ie6 and firefox solution: function preview(what) { if(jQuery.browser.msie) { document.getElementById("preview-photo").src=what.value; return; } else if(jQuery.browser.safari) { document.getElementById("preview-photo").src=what.value; return; } document.getElementById("preview-photo").src=what.files[0].getAsDataURL(); //