attachment

Handle attachment in response with RequestBuilder in GWT

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 03:57:24
I am making a HTTP POST request from GWT Client to a HTTPServlet. This Servlet is creating a PDF file from request content and writing it to response stream. Headers of the response stream are: Content-Disposition: attachment; filename=report.pdf I want to open this PDF in new window of the user's browser or prompt him to download it. import com.google.gwt.http.client.*; ... String url = "http://www.myserver.com/getData?type=3"; RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, URL.encode(url)); try { Request request = builder.sendRequest(data, new RequestCallback() { public

sp_send_dbmail executed from job fails with query result attached as file

陌路散爱 提交于 2019-11-29 03:13:35
I have faced with the following issue: when trying to send email with results of query attached as file, using sp_send_dbmail via executing ordinary query everything seems to be working OK. But if add the same code into JobStep and run the job, it fails. Error in job history says Error formatting query, probably invalid parameters [SQLSTATE 42000] (Error 22050). The step failed. But when I comment out parameter that refers to file attaching it starts working correctly again. exec msdb.dbo.sp_send_dbmail @profile_name = 'profile_name', @recipients = 'some@mail.com', @body = 'body', @subject =

Android Attaching a file to GMAIL - Can't attach empty file

房东的猫 提交于 2019-11-29 03:05:43
I had a program that would always attach the same file to GMAIL (Compose > Attach File > Open From > "MyProgram"). It would always select the same file. What it was doing was: String path = Environment.getExternalStorageDirectory() + "/file.3gp"; File f = new File(path); Uri data = Uri.fromFile(f); Intent i = new Intent(); i.setData(data); setResult(Activity.RESULT_OK, i); finish(); This was working fine until Android 6.0. Now, I receive the following error when trying to use it: Can't attach empty file Astro File Sharing is giving me the same error (can be an old build). However, I installed

Show Attached Image to Post on Wordpress

ぐ巨炮叔叔 提交于 2019-11-29 01:14:01
问题 How i can show attached images of my posts on Wordpress? 回答1: Try this in your single.php template: $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $post->ID ); $images = get_posts( $args ); foreach($images as $image): echo wp_get_attachment_image($image->ID, 'medium'); endforeach; 回答2: wp_get_attachment_image 来源: https://stackoverflow.com/questions/1815158/show-attached-image-to-post-on-wordpress

how send file (txt/XML) from iphone to server(web or email)

。_饼干妹妹 提交于 2019-11-29 00:27:46
Hi I want to send text or XML from iphone to another desktop machine. Is there any way so that I can use Email to send file as attachment or can send it by HTTP POST method. Please help me. You can HTTP POST it: NSString * xmlString = @"<test><message length="5">Hello</message></test>"; NSURL * serviceUrl = [NSURL URLWithString:@"http://my.company.com/myservice"]; NSMutableURLRequest * serviceRequest = [NSMutableURLRequest requestWithURL:serviceUrl]; [serviceRequest setValue:@"text/xml" forHTTPHeaderField:@"Content-type"]; [serviceRequest setHTTPMethod:@"POST"]; [serviceRequest setHTTPBody:

How to create new post with photo attached in WordPress using XMLRPC?

自古美人都是妖i 提交于 2019-11-29 00:18:18
Anyone knows how to create new post with photo attached in WordPress using XMLRPC? I am able to create new post and upload new picture separately, but looks like there is no way to attach the uploaded photo to the created post? Below is the codes I'm currently using. <?php DEFINE('WP_XMLRPC_URL', 'http://www.blog.com/xmlrpc.php'); DEFINE('WP_USERNAME', 'username'); DEFINE('WP_PASSWORD', 'password'); require_once("./IXR_Library.php"); $rpc = new IXR_Client(WP_XMLRPC_URL); $status = $rpc->query("system.listMethods"); // method name if(!$status){ print "Error (".$rpc->getErrorCode().") : "; print

What to do when - java.io.FileNotFoundException: No content provider?

≡放荡痞女 提交于 2019-11-28 22:47:32
问题 when I try to attach a file to an email, I get a java.io.FileNotFoundException: No content provider logcat output. If anyone could tell me what I am doing wrong or what I should do instead, that would be great.Thank you. This is how I add the files to the email..: Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_STREAM, uri); sendIntent.setType("video/3gp"); sendIntent.setType("video/mp4"); startActivity(sendIntent); ...and here is the entire logcat error

Sending emails with attachment in django

不羁岁月 提交于 2019-11-28 22:23:07
问题 I'm trying to send email with some images attached in django. Code used is this snippet : http://www.djangosnippets.org/snippets/1063/. Dunno why the attachment part returns me a core error. The code. forms.py from django import forms from common import slugify_unique from django.conf import settings from django.core.cache import cache from django.contrib.admin import widgets from django.shortcuts import get_object_or_404 class WorkForm(forms.Form): name = forms.CharField(label='Name and

How can a Delphi Program send an Email with Attachments via the DEFAULT E-mail Client?

元气小坏坏 提交于 2019-11-28 21:26:44
问题 Within my program, I am composing an email to send using the default e-mail client software installed on a user's machine. I have composed the mailto address, the subject, the multilined body, and I have several attachments to be included. I almost got this working using mailto and ShellExecute as follows: Message := 'mailto:someone@somewhere.com' + '?subject=This is the subjectBehold Error Report' + '&body=This is line 1' + '%0D%0A' + 'This is line 2' + '%0D%0A' + 'This is line 3' + '&Attach

HTTP response header content disposition for attachments

此生再无相见时 提交于 2019-11-28 21:14:06
问题 Background Write an XML document to a browser's response stream and cause the browser to display a "Save As" dialog. Problem Consider the following download() method: HttpServletResponse response = getResponse(); BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( response.getOutputStream() ) ); String filename = "domain.xml"; String mimeType = new MimetypesFileTypeMap().getContentType( filename ); // Prints "application/octet-stream" System.out.println( "mimeType: " + mimeType );