image-uploading

Image loss quality after upload via HttpPostedFile.SaveAs(imgPath)

99封情书 提交于 2019-12-24 14:06:06
问题 I'm working in a project that doesn't use much of the .net framework and instead work with Request.Form posts. The code that was being used to save the images (this work, but loss quality) is this one: files[0].SaveAs(HttpContext.Current.Server.MapPath("../uploads/") + filename); So I tried to change to this, but now it doesn't even save the image. (the uploadStream.Read(buffer, 0, buffer.Length) comes with the value of 0. string imagePath = HttpContext.Current.Server.MapPath("../uploads/") +

Email form sends multiple mails depending on attachments

心已入冬 提交于 2019-12-24 13:48:17
问题 So basically I want an email system that can send a message with one or more pictures, the problem I have now is that when I upload let's say 4 pictures, the form sends me 4 emails with both the same text but one picture at a time. I want them all to be added as 4 attachments to 1 email, not 1 attachment to 4 emails. Here is my HTML: <form id="upload" method="post" action="upload.php"> <div id="drop"> Onderwerp<br> <input name="txtSubject" type="text" id="txtSubject" /><br> Omschrijving<br>

MVC: get uploaded filename back in grid column

一世执手 提交于 2019-12-24 12:43:57
问题 I have an MVC razor form with a Kendo grid. The grid has an asynch image uploader. @(Html.Kendo().Grid<CraftStore.Models.Catalog>() .Name("CatalogGrid") .Columns(columns => { columns.Bound(p => p.CatalogName).Filterable(true).Width(240); columns.Bound(p => p.CatalogDescription).Filterable(true).Width(340); columns.Bound(p => p.ModelNumber).Filterable(true).Width(110); columns.Bound(p => p.SerialNumber).Filterable(true).Width(110); columns.Bound(p => p.InventoryCount).Filterable(true).Width

Can not convert HttpPostedFileBase object into byte array

让人想犯罪 __ 提交于 2019-12-24 06:05:17
问题 I am trying to create a method where I can pass an image file and retrieve bytes of that image file, so later I can store the bytes in database. Here is my code for the method. private byte[] GetImageBytes(HttpPostedFileBase ProfilePhoto) { if (ProfilePhoto != null) { using (MemoryStream ms = new MemoryStream()) { ProfilePhoto.InputStream.CopyTo(ms); byte[] array = ms.GetBuffer(); return array; } } else { return null; } } The problem is that I get an array of bytes array[0], so there is

How to store path image users into a database: Codeigniter

南笙酒味 提交于 2019-12-24 02:18:54
问题 I am trying to upload the paths of the pictures for different users into at database. I am quite new on codeigniter and I read a lot of tutorials, but I am sill struggling. This is my controller but I don't even know how to link the image with the user session. Here is my code: function do_upload() { $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $config['overwrite

Uploading image using SpringMVC 4.0 Multipart

倖福魔咒の 提交于 2019-12-24 01:49:25
问题 I'm trying to upload an image online using the code below. But, the image doesn't seem to be created in the images folder for some reason. Not sure, what Im doing wrong in here. @RequestMapping(value="/add", method=RequestMethod.POST) public String processAddNewProductForm(@ModelAttribute("newProduct") Product productToBeAdded, BindingResult result, HttpServletRequest request) { String[] supressedFields = result.getSuppressedFields(); if(supressedFields.length > 0) { throw new

How to get the name of userfiles in controller to add to database

不羁的心 提交于 2019-12-24 00:48:30
问题 This is the code so far. I have 2 images that are getting uploaded and added to the desired map. My question is, how do i get both names from the images so I can add just the names to the database together with my other form information. public function CreateTypesForGamma() { $type = new stdClass(); $type->TypeID = $this->input->post('typeID') == 0 ? null : $this->input->post('typeID'); $type->Titel = $this->input->post('titel'); $type->TechnischeFiche = $this->input->post('technischeFiche')

How to post an image to server in android

放肆的年华 提交于 2019-12-24 00:40:43
问题 How do I upload an image to the Server? Both MultiPArtEntity and MultiPartEntityBuilder classes are deprecated in API level 23. Can we do this using HTTPUrlConnection or volley? 回答1: I suggest that you use OkHttp. More details about it you can find at the following: OkHttp - An HTTP & SPDY client for Android and Java applications Please refer to my basic sample code that uploads a PNG file from drawable folder to remote web service. Hope this helps! ... mTextView = (TextView) findViewById(R

Jquery File Upload - How to limit number of files uploaded

半世苍凉 提交于 2019-12-23 19:41:32
问题 I am trying out Jquery File Upload from blueimp. The documentation says I should be able to limit the number of files to be uploaded with the maxNumberOfFiles setting. However, that doesn't seem to be working in my case. None of the others such as acceptFileTypes, loadImageMaxFileSize etc seem to be working either (probably I have to include other js files? - don't know really which ones or how to hook em up despite researching quite a lot) . I am using the basic version of the plugin. Here

FileNotFoundException while uploading image using Retrofit

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 17:56:36
问题 I tried to upload an image using Retrofit but I am getting this error: Unable to submit post to API: java.io.FileNotFoundException: /document/image:30231: open failed: ENOENT (No such file or directory) My interface is like this: public interface MyService{ @Multipart @POST("/url") Call<ResponseBody> addNewEvent( @Part("case_Id") int caseId,@Part MultipartBody.Part(file); } On Button click, selectImage() function is called: private void selectImage() { Intent intent = new Intent(); intent