attachment

How to rewrite and set headers at the same time in Apache

纵饮孤独 提交于 2019-12-07 13:32:26
问题 I have a directory of images that alternately be viewed directly in the browser, and other times downloaded. So, say I have a file /gallery/gal_4254.jpg. I want to make /download/gal_4254.jpg trigger a download of the image rather than view it. /download is empty, all the images are in /gallery. I can map requests to the download dir to the other files successfully <Directory /var/www/download> RewriteEngine on RewriteRule (.*)$ /gallery/$1 </Directory> and I already can force downloads in

Change error validation message in Paperclip

£可爱£侵袭症+ 提交于 2019-12-07 01:43:49
问题 When you set a validation message in paperclip, such as validates_attachment_presence, :image, :message => 'xxxx' The custom message comes automatically prefixed with the name of the field, even though it has been overwritten with the :message . How do you totally override the message and make it totally custom? Edit: typo 回答1: Not a real solution but a Easy one is to skip paperclip validation and write custom one. validate :check_content_type def check_content_type if !['image/jpeg', 'image

ICS in Outlook being sent as a .msg file

◇◆丶佛笑我妖孽 提交于 2019-12-07 00:33:39
问题 I have an application, it is creating an ICS similar to the following: BEGIN:VCALENDAR VERSION:2.0 METHOD:REQUEST BEGIN:VEVENT ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:test1234@gmail.com ORGANIZER:MAILTO:test1234@org.com DTSTART:20100803T190000Z DTEND:20100803T200000Z LOCATION:Go to http://100.200.0.55/Login/ParticipantLogIn.asp and enter Conference ID: 0000 SEQUENCE:0 UID:352C75A6-0117-4B3A-AFE6-7B18649CD45A DTSTAMP:20100803T184455Z DESCRIPTION:TO ACCESS THE WEB CONFERENCE:\n\n Click

php - Create file from string and attach to email

痞子三分冷 提交于 2019-12-06 16:44:18
I have an application in which users can send me feedback. When they do this, various data from their system is posted to a php file on my server. The php file then handles that data and sends me an email with that data via mail(). Right now, all of the data is just composed into an HTML email. What I want to do is take some of the posted data, convert them to files, and add them as attachments to the email. I know how to add files as attachments with mail(). I just can't think of a way to create the files first. I thought of just using fopen() and fwrite(), but then what if two users are

Sending an E-Mail with attachments in Cocoa

北慕城南 提交于 2019-12-06 15:04:07
问题 I have an NSTextView with text & images in it, which is supposed to send both in an e-mail.I know that the message.framework is deprecated,so I came up with the idea to send it via NSTask, since mail is integrated.I came up with the code below, however in the log I get this: *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: _NSTaskInputFileHandle) This is the code I am using: NSError *error; if([textView writeRTFDToFile:@"/Library/Application Support/log.rtfd"

Rails3, S3, Paperclip Attachment as it's own model?

左心房为你撑大大i 提交于 2019-12-06 14:44:58
So, I'm working on an app where users can upload and manage photos with a bunch of industry specific metadata attached to them. The Photo model has all this metadata in it, and I'm using Paperclip to attach the actual image file to the model and store the images on Amazon S3. The user interaction currently works like this: A user clicks "Add Photo" and is taken to the "New Photo" page where he is presented a form. The first thing on the form is a file chooser. The user selects a file. Beneath this are several different fields of metadata for the user to fill out, so the user fills these out.

Attaching a file from secure storage in Gmail from my app

微笑、不失礼 提交于 2019-12-06 14:41:29
My app has an option to send out the log, which is store in the app's secure storage. The path to the file is "/data/data/com.mycompany.myapp/files/log.zip". The file's permissions have been chnged to MODE_WORLD_READABLE, and the intent to launch email is: Intent i = new Intent(Intent.ACTION_SEND); i.setType("application/zip"); i.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///data/data/com.mycompany.myapp/files/log.zip)); startActivity(Intent.createChooser(i, "Send Error Log")); If the file is located on the SD card, there is no problem. But when it's secure storage, there is no attachment.

Zend_Mail: how to get attachment ID?

不想你离开。 提交于 2019-12-06 14:04:02
问题 I am using Zend to create emails. Now I will place an inline image in the HTML Part of the mail. So I am attaching the image with: $imageContent = file_get_contents(APPLICATION_PATH.'../html/static/img/image.jpg'); $image = $mail->createAttachment($imageContent, 'image/jpeg', Zend_Mime::DISPOSITION_INLINE, Zend_Mime::ENCODING_BASE64, 'image.png'); $imageHeaders = $image->getHeaders(); The last command is for getting the headers, where the part id is not set. But for linking the image in the

Hyperlink to Outlook Attachment

烂漫一生 提交于 2019-12-06 13:30:39
When you attach a document to an outlook email, a copy of the document is created and stored somewhere. You can obviously link to any location in the body of outlook. A hyperlink to a local document will not be useful to a recipient on another machine (without access to the local drive). But, is there a way to hyperlink to an attached file? I don't think that there is any native way to do this, but is there any possible solution? If it matters, the email will only be read by outlook. (i.e. intra office). Sure, you can refer to an attachment by its content-id. Look at the code below setting the

Exchange Web Services Attachment load is slow

冷暖自知 提交于 2019-12-06 11:02:58
I'm in the process of writing some code to download and process the attachments of email messages and then process them. The code is working as required in some cases, but still has some major problems. Whenever the code loads the attachment into a file on the local disk, it takes a very long time to do so and often times out with the following exception as a result of the slow download: A first chance exception of type 'Microsoft.Exchange.WebServices.Data.ServiceRequestException' occurred in Microsoft.Exchange.WebServices.dll I may be wrong, but if the exchange server in question is on the