upload

Flash upload image resize client side

会有一股神秘感。 提交于 2019-12-17 08:59:09
问题 Does anyone got an ideia on how to get client side image resize using flash. Example: Client chooses an image with 1200x800 and before it uploads it flash will turn it into half of it or something. Any thoughts? 回答1: Plupload is Opensource, has good documentation and supports multiple platforms, including Gears and HTML5! http://www.plupload.com/index.php http://www.plupload.com/example_all_runtimes.php Ah, yes, it supports resizing images BEFORE uploading. The closest option to aurigma, but

Django admin file upload with current model id

醉酒当歌 提交于 2019-12-17 08:54:07
问题 I'm trying to create a simple photo gallery with the default Django admin. I'd like to save a sample photo for each gallery, but I don't want to keep the filname. Instead of the filename, I'd like to save the id of the model ( N.jpg ). But the first time I want to save the object the id does not exist. How could I know the next auto increment in the model, or somehow save the model data before the upload with super.save and after upload the file when self.id is exists? Is there a cool

Fix iOS picture orientation after upload PHP

╄→尐↘猪︶ㄣ 提交于 2019-12-17 08:53:31
问题 Is there a way to rotate a picture with PHP only if it is not correctly positioned after uploaded from iOS? Some pictures are rotated 90 degrees while others upload correctly. 回答1: The image is rotating because you are saving the image in JPEG, if you save your image in PNG then the orientation will not change. here is the code to fix orientation issue. - (UIImage *)fixrotation:(UIImage *)image{ if (image.imageOrientation == UIImageOrientationUp) return image; CGAffineTransform transform =

Can't grab progress on http POST file upload (Android)

佐手、 提交于 2019-12-17 08:53:18
问题 I am developing an Android app which enables the user to upload a file to services like Twitpic and others. The POST upload is done without any external libraries and works just fine. My only problem is, that I can't grab any progress because all the uploading is done when I receive the response, not while writing the bytes into the outputstream. Here is what I do: URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn

Remove selected file(s) before upload with Javascript

試著忘記壹切 提交于 2019-12-17 07:50:29
问题 Say I have a form that allows users to upload multiple images, which are appended with an option to remove them if they don't want to upload that particular photo. Is it possible to remove the value from the files object of the one that they removed (e.g. didn't want to upload)? 回答1: FileList has no API to remove entries: https://developer.mozilla.org/en/DOM/FileList However you can reconstruct File uploader using XHR2 and AJAX and filter in content there. This implies doing XHR2 and AJAX

Remove selected file(s) before upload with Javascript

喜夏-厌秋 提交于 2019-12-17 07:50:24
问题 Say I have a form that allows users to upload multiple images, which are appended with an option to remove them if they don't want to upload that particular photo. Is it possible to remove the value from the files object of the one that they removed (e.g. didn't want to upload)? 回答1: FileList has no API to remove entries: https://developer.mozilla.org/en/DOM/FileList However you can reconstruct File uploader using XHR2 and AJAX and filter in content there. This implies doing XHR2 and AJAX

uploading a file in chunks using html5

陌路散爱 提交于 2019-12-17 07:13:07
问题 I am trying to upload a file in chunks using html5's File API and then reassembling it on the server side in php. I am uploading a video but when i merge the files in server side the size has increased and it is becoming a invalid file . Please note the below html5 code only works in browser chrome . Tested in Chrome 9 as this uses file API's slice function . Can some one guide me on this ? Thanks PHP source <?php $target_path = "uploads/"; $tmp_name = $_FILES['fileToUpload']['tmp_name'];

Very large uploads with PHP

丶灬走出姿态 提交于 2019-12-17 06:27:16
问题 I want to allow uploads of very large files into our PHP application (hundred of megs - 8 gigs). There are a couple of problems with this however. Browser: HTML uploads have crappy feedback, we need to either poll for progress (which is a bit silly) or show no feedback at all Flash uploader puts entire file into memory before starting the upload Server: PHP forces us to set post_max_size, which could result in an easily exploitable DOS attack. I'd like to not set this setting globally. The

Custom Upload Button

☆樱花仙子☆ 提交于 2019-12-17 06:10:50
问题 hi i was just wondering how you can create you own custom file upload button, because the best i can do is and what i want to achieve is if there is anyway of doing this i would be very thankful, and please can i have answers that explain how to do it with code and not answers with links to websites that allow you to download a button or something like that,Thank You :) 回答1: Although some of these answers will create something that looks like you want it to work, they will break down when

fileReader.readAsBinaryString to upload files

北慕城南 提交于 2019-12-17 05:34:37
问题 Trying to use fileReader.readAsBinaryString to upload a PNG file to the server via AJAX, stripped down code (fileObject is the object containing info on my file); var fileReader = new FileReader(); fileReader.onload = function(e) { var xmlHttpRequest = new XMLHttpRequest(); //Some AJAX-y stuff - callbacks, handlers etc. xmlHttpRequest.open("POST", '/pushfile', true); var dashes = '--'; var boundary = 'aperturephotoupload'; var crlf = "\r\n"; //Post with the correct MIME type (If the OS can