image-uploading

File upload with Symfony3 not working

雨燕双飞 提交于 2019-11-28 14:43:18
I am trying to upload file with Symfony3 but with no luck. I have a Profile entity which is linked to User entity with 1-1 relationship. The profile contains a picture column. I have created a ProfileType and Profile Model. Upon submitting the form, the model contains only the File name and nothing else. The $_FILES array is also empty. This is the code. $builder ->add("name", TextType::class, array( "required" => true, )) ->add("email", EmailType::class, array( "required" => true, )) ->add("city", TextType::class, array( "required" => false, )) ->add("country", ChoiceType::class, array(

upload image binary - using imageshack api

余生长醉 提交于 2019-11-28 14:31:58
Moving a topic from google groups to here so it can help someone who is asking. imageshack api: http://api.imageshack.us/ the final http reqeust is returning json: {"success":true,"process_time":325,"result":{"max_filesize":5242880,"space_limit":52428800,"space_used":0,"space_left":52428800,"passed":0,"failed":0,"total":0,"images":[]}} which is not good, as it didn't upload :( it should return an image object. http://api.imageshack.us/#h.ws82a1l6pp9g as this is what the upload image section on the imageshack api says please help :( my extension code var blobUrl; var makeBlob = function () {

Uploading image on server, receiving rotated image

岁酱吖の 提交于 2019-11-28 12:58:57
In my application I want to upload the image to the server and retrieve the url of uploaded image to display it in the application. I send the NSData of image. Here is my code : AsynchronousImageView *imgVw_User = (AsynchronousImageView*)[self.view viewWithTag:K_TagImageViewUser]; UIImage *UserImgForBioData = imgVw_User.image; UserImgForBioData = [UIImage imageWithCGImage:UserImgForBioData.CGImage scale:1.0f orientation:UserImgForBioData.imageOrientation]; NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(UserImgForBioData,0.5)]; Base64Transcoder *temp_transcoder=[

Upload an image to two different paths

送分小仙女□ 提交于 2019-11-28 10:42:14
问题 How to upload an image and save it in two different folders, ./imgup/web/data_dinamis/ and ./imgup/web/video/ ? My code to upload image : $config['upload_path'] = './imgup/web/data_dinamis/'; $config['upload_path'] = './imgup/web/video/'; $config['allowed_types'] = '*'; $config['file_name'] = $nama_baru; $this->load->library('upload',$config); $this->upload->do_upload('file'); $this->upload->display_errors(); $berita = array( 'user_id' => $this->session->userdata('user')->user_id, 'kategori

Upload image in Flask

放肆的年华 提交于 2019-11-28 09:09:40
I have to upload some images in static folder of my project directory, but i don't know how to say it to my code. In the follow code.py i'm able to upload an image and store it in the project directory at the same level of static folder, but i would that this image can be store INSIDE static folder. @app.route('/uploader', methods = ['GET', 'POST']) def upload_file(): if request.method == 'POST': f = request.files['file'] f.save(secure_filename(f.filename)) return render_template('end.html') What i have to do?? Thanks guys you need to define the upload folder from the flask documentation

Flutter: http post upload an image

纵饮孤独 提交于 2019-11-28 08:23:20
I use a web service for image processing , it works well in Postman: Now I want to make http request in flutter with Dart: import 'package:http/http.dart' as http; static ocr(File image) async { var url = '${API_URL}ocr'; var bytes = image.readAsBytesSync(); var response = await http.post( url, headers:{ "Content-Type":"multipart/form-data" } , body: { "lang":"fas" , "image":bytes}, encoding: Encoding.getByName("utf-8") ); return response.body; } but I don't know how to upload the image file, in above code I get exception: Bad state: Cannot set the body fields of a Request with content-type

CodeIgniter “The filetype you are attempting to upload is not allowed.”

让人想犯罪 __ 提交于 2019-11-28 07:56:03
问题 I was searching a lot and found many questions regarding this problem, unfortunately none of answers did help me. I'm trying to upload a png image, and I'm receiving the following error: The filetype you are attempting to upload is not allowed. I was following this CI guide to build my code: http://codeigniter.com/user_guide/libraries/file_uploading.html Here is what I got: view file: [..] <?= form_open_multipart() ?> <input type="file" name="userfile" size="20" /> <br /><br /> <input type=

Android get Gallery image Uri path

左心房为你撑大大i 提交于 2019-11-28 07:12:53
In an Activity, I can choose an image from the Gallery, and I need its Uri path (in the log, the Uri path for my test image is /content:/media/external/images/media/1 ). I'm getting this error though: 08-04 02:14:21.912: DEBUG/PHOTOUPLOADER(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) 08-04 02:14:32.124: WARN/System.err(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) Is this the correct format of a file path? Or should I make it to be something like sdcard\...\image.png ? Allan

in asp.net-mvc, is there a good library or pattern to follow when saving users content (images, files, etc)

一世执手 提交于 2019-11-28 07:02:30
i have an admin section of my website where "authors" can upload files like pictures for photo galleries, etc to include in dynamic content sections of my website later. I have certain pages where the html itself is stored in my mySQL database and users can edit the content using ckeditor interface. i am trying to see if there is something to leverage that will save files to the right directory and retrieve them later or i should just write this all from scratch. Also, looking for lessons learned and things to be careful on (security, etc . .) I'll take a stab at this. An application that we

Android okHttp addFormDataPart dynamically for Multiple Image

試著忘記壹切 提交于 2019-11-28 07:00:36
Hello AndroidUploaders, I had given answer Uploading a large file in multipart using OkHttp but i am stuck with multiple image uploading. I want to upload dynamically 1 to 10 image at a time. RequestBody requestBody = new MultipartBuilder() .type(MultipartBuilder.FORM) .addFormDataPart(KEY_PHOTO_CAPTION, photoCaption) .addFormDataPart(KEY_FILE, "profile.png", RequestBody.create(MEDIA_TYPE_PNG, sourceFile)) .build(); I have ArrayList of PhotoCaption class which has captionPhoto and urlPhoto so how can i addFormDataPart() I am thinking to make loop and call this function that many times of