upload

How do I reduce the quality of an image in byte format on Android?

旧街凉风 提交于 2019-12-11 03:56:14
问题 Using resources from StackOverflow and other helpful websites, I was successful in creating an application that can upload an image taken by the camera application on an Android phone. The only trouble is, the phone I have right now takes very high-quality pictures, resulting in a long wait-time for uploads. I read about converting images from jpeg to a lower rate (smaller size or just web-friendly sizes), but the code I am using right now saves the captured image as a byte (see code below).

Add extra params to $cordovaFileTransfer.upload

可紊 提交于 2019-12-11 03:46:58
问题 I am using $cordovaFileTransfer.upload() to upload a picture from a device to my server. In documentation it says that it excepts these params: server, filePath, options . I need to pass in some extra custom params: like user_id , for example. Does anyone know if it's possible to do? Thank you. 回答1: You can send those custom parameters in the options object, doing something like this: var options = {}; options.headers = { Connection: "close" } options.chunkedMode = false; options.userName =

Post multiple files by List<HttpPostedFileBase>

谁说胖子不能爱 提交于 2019-12-11 03:45:08
问题 I just want to post my multiple files to controller via model. class myModel{ public List<string> contexts {get;set;} public List<HttpPostedFileBase> images {get;set;} } And there is Html <input id="myImages" type=file multiple="multiple> User add files to input tag and text inputs creating dynamically based on files count <input id="text0"></input> <input id="text1"></input> <input id="text3"></input> ... . After user fill the text inputs. hit the save button. and I want to pass these datas

HTML5 to display uploaded image untill next one is uploaded?

左心房为你撑大大i 提交于 2019-12-11 03:45:05
问题 I'm not sure if I should use HTML5 storage for this or not. My question is about how I can accomplish the following: Think of a wall in a museum with an empty frame. I want the user to upload an image from his or her computer. This image will than be shown in the frame on the wall (a div). If the user wants to check another image, the previous image can be 'removed' and the next should show up. In the fiddle below is an example of html5 storage, but it stores multiple images. I just want one

get filename of file uploaded through ajax

青春壹個敷衍的年華 提交于 2019-12-11 03:39:50
问题 My problem is quite simple. I am writing an uploader class in php and have decided to include support for ajax uploads. Using firefox, I detected that a header X-File-Name is sent. I am using a 3rd party javascript library for the uploads, and it sends the filename in a query string to the php script. What I wish to know is, is there a consistent means of getting the filename like through the X-File-Name that is consistent with all ajax requests or I need users to specify the name of the file

Debian Jessie - Apache2 / PHP 5.6, can't upload more than 128kb

南笙酒味 提交于 2019-12-11 03:17:22
问题 I've got a problem which is bugging me like crazy! I've recently updated my server to Jessie (wishing I hadn't at the moment!) but ever since I did, I can't upload more than 128KB in a single upload. I've tried all the usual obvious options - checking php.ini for max file size, execution times, etc but with no solution. ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://php.net/file-uploads file_uploads = On ; Temporary directory for HTTP

Paperclip and S3: Multiple thumbnail sizes not saving

微笑、不失礼 提交于 2019-12-11 03:13:09
问题 I'm using Paperclip to handle image uploads for my Rails app, and it's working great when I use system storage: multiple thumbnail sizes ("styles" in Paperclip parlance) are saved to file, and I can access any of them by passing the style name to the url method. When I set up the app to store images on S3 (using the aws-s3 gem), however, only one image is stored in my S3 bucket. For what it's worth, only the last style listed is stored. So, if in my model, I've got: has_attached_file :photo,

php upload script won't work

淺唱寂寞╮ 提交于 2019-12-11 02:58:22
问题 I wanna make uploads of pictures possible on my homepage. I'm using a script by w3schools to do this: This is the upload.html <!DOCTYPE html> <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> And this is the upload.php <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES[

HTML - I upload new image to site, old image still loads

家住魔仙堡 提交于 2019-12-11 02:46:44
问题 I am running a linux script that downloads a picture from my website every hour, but when I change the image (by uploading a new one with the same name), such as www.mywebsite.com/images/myimage.jpg , the old copy keeps getting downloaded. Is there a certain amount of time it takes? I use MyDomain.com as my hosting website and use their FileManager to upload a new picture (but it overwrites the old one keeping the same name). Any tips on how to handle this? Even in a web browser (opposed to

How do I get URL of upload file into script

风格不统一 提交于 2019-12-11 02:44:23
问题 Upon upload completion, my newly uploaded file has the URL of <div id="uploaded-file"> <img src="http://path-to-my-file.jpg" /> </div> How do I get the URL of that uploaded file into my script? <script> script stuff.use this.etc ('http://path-to-my-file.jpg') }); </script> Thanks in advance for any assistance! EDIT: I used: <script> var myurl = document.getElementById("uploaded-file").getElementsByTagName("img")[0].src; </script> then replace the hardcoded url: Layer_3.mousedown(function() {