attachment

How can I link source to a jar package in eclipse?

こ雲淡風輕ζ 提交于 2019-12-17 19:15:03
问题 How can I link source to a jar package in eclipse? I am trying to add the external library ch.ntb.usb. I added the jar file to my build path, but when I tried to run the application it returned the following error: The jar file ch.ntb.usb has no source attachment. I've used JD-GUI to decompile the jar file and the source code is contained. 回答1: I doubt that you get that error when you only run the project unless you have an error in your code and eclipse debugger try to show the line of code

How do I write a restful web service that accepts a binary file (pdf)

五迷三道 提交于 2019-12-17 15:34:58
问题 I'm trying to write a restful web service in java that will take a few string params and a binary file (pdf) param. I understand how to do the strings but I'm getting hung up on the binary file. Any ideas / examples? Here's what I have so far @GET @ConsumeMime("multipart/form-data") @ProduceMime("text/plain") @Path("submit/{client_id}/{doc_id}/{html}/{password}") public Response submit(@PathParam("client_id") String clientID, @PathParam("doc_id") String docID, @PathParam("html") String html,

How to index a pdf file in Elasticsearch 5.0.0 with ingest-attachment plugin?

99封情书 提交于 2019-12-17 10:32:39
问题 I'm new to Elasticsearch and I read here https://www.elastic.co/guide/en/elasticsearch/plugins/master/mapper-attachments.html that the mapper-attachments plugin is deprecated in elasticsearch 5.0.0. I now try to index a pdf file with the new ingest-attachment plugin and upload the attachment. What I've tried so far is curl -H 'Content-Type: application/pdf' -XPOST localhost:9200/test/1 -d @/cygdrive/c/test/test.pdf but I get the following error: {"error":{"root_cause":[{"type":"mapper_parsing

Send PHP HTML mail with attachments

独自空忆成欢 提交于 2019-12-17 07:18:10
问题 I got a problem: Until today, I sent HTML mails with PHP using a header which contains Content-type: text/html; Now, I added functionality to add attachments. For this, I had to change this line to Content-Type: multipart/mixed; Now, with multipart/mixed , the rest of the mail, so the normal text, gets shown just as text/plain. How can I realize that attachments work and the mailtext is still HTML? 回答1: To send an email with attachment we need to use the multipart/mixed MIME type that

Storing an image into an Attachment field in an Access database

时光毁灭记忆、已成空白 提交于 2019-12-17 04:07:28
问题 I'm writing a VB application where I need to store an image in the database. The user selects the image on their computer, which gives me the path as a string. Here's my attempt at it, however I'm getting the error "An INSERT INTO query cannot contain a multi-valued field." Here is my code: Dim buff As Byte() = Nothing Public Function ReadByteArrayFromFile(ByVal fileName As String) As Byte() Dim fs As New FileStream(fileName, FileMode.Open, FileAccess.Read) Dim br As New BinaryReader(fs) Dim

Mule no object DCH for MIME type application/pdf

那年仲夏 提交于 2019-12-14 03:58:07
问题 I am trying to Set an Attachment as below: <set-attachment attachmentName="abc" value="#[contents]" contentType="#[fileType]" doc:name="Attachment"/> The contentType happens to be application/pdf. I get the following error for .pdf and .doc files. text/plain files go through ok. no object DCH for MIME type application/pdf (javax.activation.UnsupportedDataTypeException) javax.activation.ObjectDataContentHandler:891 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation

How to Add attachments to an existing work item in Azure DevOps using c#

£可爱£侵袭症+ 提交于 2019-12-13 20:58:42
问题 Would you please provide a code sample on how to add attachments (text file and an image) to an existing work item in Azure DevOps using C#. 回答1: Here are some blog and cases: 1 . 2 with C# code samples, you can refer to them. using (FileStream attStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read)) { var att = WitClient.CreateAttachmentAsync(attStream, filePathSplit[filePathSplit.Length – 1]).Result; // upload the file JsonPatchDocument patchDocument = new JsonPatchDocument();

How do I read the attachment content on a Defect

亡梦爱人 提交于 2019-12-13 20:51:26
问题 Using the Rally Java Rest API , after I get the AttachmentContent object, how do I actually get the bytes which hold the content? 回答1: You may find the following example to be useful for what you are wanting to do. It's for a User Story rather than a Defect but the process would be identical for a Defect. import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.rallydev.rest.RallyRestApi; import com.rallydev.rest.request.CreateRequest

Email attachment send by app has different name than file that is sent

萝らか妹 提交于 2019-12-13 19:11:15
问题 I am writing an android app which has a feature that will send an email with an attachment of a specific document. This is working but the attachment, which is called "peroneal.pdf" when I attach it to the email, (as an intent, which I'm sure is where the issue is) becomes "2131034113.pdf" when the email is received. How do I change it so that the received document has the original name? Does it have to do with naming the intent? If so, how do I do this? Thanks in advance for any help, I have

JIRA API attachment names contain the whole paths of the posted files

浪尽此生 提交于 2019-12-13 18:14:46
问题 I have been working with Jira API and have seen inconsistent results for my requests. Sometimes it works and sometimes it doesn't. Last week I was able to post attachments to issues just fine, but now an old problem occurred: the names of the attachments contain the whole path of the posted file, hence the attachments can't be opened. I use json representation to post files: $array = array("file"=>"@filename"); json_encode($array); ... This gets the file posted but the problem is when it's