Questions tagged [mime]

0

votes
0

answer
7

Views

Gmail not threading replies sent via API

I'm trying to send replies via the Gmail API in Python and can't seem to get the Gmail web client to thread the messages. However, they are being threaded in Outlook, which is very strange. Here's how I'm creating the messages: def create_message(sender, to, subject, message_text, reply_to, thread_i...
Adam Bowker
1

votes
1

answer
2.1k

Views

Register Silverlight MIME Types in IIS Programmatically

I am creating an installer for a silverlight application and would like to be able to register the .xap extension for IIS automatically. Is there a way to accomplish this without editing the registry? If not, what registry entries to I need to make? Thanks!
1

votes
2

answer
4.7k

Views

Problems using multipart_encode (poster library)

I am trying to upload a file using multipart_encode to realize the MIME process. However, I met the following error AttributeError: multipart_yielder instance has no attribute '__len__'. Below are is my approach, I really appreciate if anyone can give me some suggestions. url = "https://pi-user-file...
TH339
1

votes
1

answer
27

Views

Python: copy svg string to “image/svg+xml” format in windows clipboard, so can paste it as an svg image

Say I have the xml contents of an svg file like this: ... My question is, how to copy this string to windows clipboard, not as string, but as "image/svg+xml" data type, which can be pasted into powerpoint as an svg image?
Alex
1

votes
1

answer
3.6k

Views

Send csv-file as attachment via MIMEBase - python

I don't get it. I try to send an e-mail with a csv-file as attachment. The first run with the script was fine, I recieved the e-mail with the csv-file as attachment. But after running it once, the script crashes with an odd Traceback message. Heres my code so far: import smtplib import email.utils...
jwi
1

votes
5

answer
331

Views

PHP control if image url is referring to specific image EXT [closed]

i wrote this function: function isImage($url) { $params = array('http' => array( 'method' => 'HEAD' )); $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); if (!$fp) return false; // Problem with url $meta = stream_get_meta_data($fp); if ($meta === false) { fclose($fp); r...
itsme
1

votes
2

answer
913

Views

.f4v files not returning as video/mp4 MIME type

when I run this script to find out the MIME type of files the MIME type returned for .f4v files are returned as application/octet-stream and not video/mp4. This makes it impossible to upload .fv4 files on my site as the critira are for files to either have a MIME type of video/mp4,video/x-flv or vid...
user1559811
1

votes
2

answer
3.2k

Views

How do I properly send a PDF file through PHP?

I am trying to send a PDF file. Here is the code that is executing: $file_path = '/path/to/file/filename.pdf' $file_name = 'filename.pdf' header("X-Sendfile: $file_path"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename='$filename'"); readfile($fil...
GSto
1

votes
1

answer
4.9k

Views

how to create an “offline” Java MimeMessage?

Java MimeMessage seems to require a Folder or Session for instantiation. Is there a sort of "offline" variety which allows creation of the message first, and then later it can be turned into a full-fledged MIME message? I'd like to stay within Java SE, but alternate API's would be ok if there's no...
Thufir
1

votes
3

answer
1.4k

Views

PHP: Why is this forced mime download adding 2 extra empty lines?

I have a PHP script I wrote to create a .txt tab delimited file. I need to have this forced downloaded to the web browser. It does all this, but when I compare the file to the source the forced downloaded on contain two extra blank lines. Here is the code: // Force download of the tab del .txt file...
Edward
1

votes
1

answer
2k

Views

Rendering a view with custom mime type in Grails

I am attempting to render text for reponse in Grails with a custom contentType. My desired contentType is: application/vnd.api+json I am testing with the following render(contentType: "application/vnd.api+json") { message = 'some text' foo = 'bar' } which does not render throwing an exception that m...
Al-Punk
1

votes
1

answer
1.5k

Views

Show svg if mime-type equals text/xml

I am trying to use an svg-image on my home-page, basicly using following code: Everything goes fine on my pc (Linux with apache-server), however after transfer to a very limiting host, the image is no longer shown. (Note: Tested with Chrome29 and Opera12) Reason for this: it is transferred under 'te...
JVApen
1

votes
2

answer
608

Views

need help in parsing mime subject perl

I managed to get emails from gmail with their subject contains UTF-8 characters , Subject: =?utf-8?B?5L2g5aW9IOS9oOWlvQ==?= I searched the interent I found its encoded quoted-printable I tried using the shown code to decode the subject use MIME::QuotedPrint; print decode_qp("?utf-8?B?5L2g5aW9IOS9oO...
A'amer Mohamed
1

votes
1

answer
265

Views

Is “ISO8859-1” an acceptable variation/alias for “ISO-8859-1”

I've got an application that sends an email notification. When the email is generated, it includes the following in the mime source: Content-Type: text/plain; charset="ISO8859-1" Content-Transfer-Encoding: quoted-printable I've noticed that other email programs and open-source conversion tools (lik...
Mike B
1

votes
2

answer
2k

Views

How to change accept header at google chrome?

I want to see an error which will happen if I send not valid(according to XHTML standard) markup to browser. I'm using google chrome as browser, apache as server and php as script language. I've created a script with such lines: header('Content-type: application/xhtml+xml'); $content =
Viacheslav Kondratiuk
1

votes
1

answer
353

Views

Is it right that PHP's finfo returns “application/zip” MimeType for a .docx?

I am trying to get the real file type and for that I have come to PECL's finfo. $fileName = "my.docx"; $f = finfo_open(FILEINFO_MIME_TYPE); var_dump(finfo_file($f, $fileName)); // I get "application/zip" How is this right? Is this what I was supposed to get?
Michael
1

votes
1

answer
3k

Views

How to parse raw mime content in java?

I have raw mime message which contains html content, inline images and attachments. I want to parse and display the content in html page as like as mail client are displaying. Is there any java library or methods available to parse the raw mime content ?
john
1

votes
1

answer
856

Views

Correct type for source map files in script html tag

when including a javascript library, i use to ad the type="text/javascript" as an attribute to the html tag, like this: I would like to know which one is the correct value to use when including a source map file like the one provided with the production version of underscore.js. Thanks for your hel...
Throoze
1

votes
2

answer
106

Views

php - get file type from contents

I'm on the lookout for a function which gets the file type from the contents of a file. ie. public function wideImage( $width, $height, $cropped, $file ) { $cacheForInMinues = 15; $cacheName = md5( $file . $width . $height . $cropped ); if ( Cache::has( "images.{$cacheName}" ) ) { $image = Cache::ge...
Luke Snowden
6

votes
1

answer
108

Views

How to create a nested multipart / MIME envelope for Email in Go?

I'm trying to figure out how to build multipart/mime envelopes for emails in Go. The following code generates correctly-nested bodies - but the boundaries are not inserted correctly. You can see a demo on https://play.golang.org/p/XLc4DQFObRn package main import ( "bytes" "fmt" "io" "log" "math/ran...
Xeoncross
1

votes
2

answer
2.8k

Views

Multipart email PDF attachment blank

Can anyone point out what's wrong with the below code? I'm trying to send a multipart email with Python. I can get the email body to show up, but the PDF is showing blank. I can get an email with just a body to work, or one with just a PDF, but together, it won't work. s = smtplib.SMTP('smtp.gmail....
Cameron Sima
1

votes
2

answer
679

Views

HTML5 video wont play when hosted on my server, plays fine from external source

I think I have exhausted every avenue in trying to solve an issue whereby an HTML5 video won't play on my site. I have a simple demo page (below) to demonstrate where I am. I originally had a video in various formats for different browsers but for easier testing I am now just working with webm and t...
Dom19811981
1

votes
1

answer
216

Views

Mail the contents of a log file in perl

i want to mail the contents of a log file of another script . I have tried the code it works , but however the output is not i expected. I want the output in line by line exactly like in LOG.txt, but i get it in as a paragraph in the body. my $HOME ='/apps/stephen/data'; my $FILE ="$H...
stephenjacob
1

votes
1

answer
716

Views

Mail subject decoding?

I have a email subject like this: Subject: =?gbk?Q?=B3=F6=C3=C0=C1=E2=C7=BF=C1=A6=B3=E9=CA=AA=BB=FA=D2=BB=CC=A8?= =?gbk?Q?=A3=AC=D6=E9=BA=A3=B9=E3=D6=DD=C9=FA=BB=EE=B1=D8=B1=B8?= But I don't know what kind of encoding is this? Could someone help? Newbie to email protocol.
holys
1

votes
1

answer
858

Views

Starting a specific activity through NFC tag

Is it possible to launch a specific activity in an app using NFC tag? I want to start an activity called MainMap which is not the main activity. I've tried using a tag writer for writing mime record and still failing. Here's the manifest: I wrote the MIME type "application/com.km.parkit" into the NF...
Kevin Murvie
1

votes
1

answer
148

Views

Detecting mime type in Java, wrong results

I'm sort of newbie in Java, maybe i'm missing something, but i tried to get the content type of the url http://www.bunspace.com/static/photobucket/15155/dancing_buns.jpg. I tried in 2 ways: 1: URL url = new URL(path); URLConnection urlConnection = url.openConnection(); return urlConnection.getConte...
yuriscom
1

votes
2

answer
694

Views

What is the relation between Mime Type and file extension

my question is: Is there some relation between a file extension and it's mime type? I mean, if i get a file, for instance, .php and change it's extension to .png will also change it's mime type?
1

votes
1

answer
1k

Views

Flask api representation affects all the views

I need to have two logically identical views to response the same data in different content types. I use Flask RESTful. APP = flask.Flask(__name__) API = flask_restful.Api(APP) @API.representation('text/csv') def output_csv(data, code, headers=None):...
I159
1

votes
2

answer
974

Views

Python Email in HTML format mimelib

I am trying to send two dataframes created in Pandas Python as a html format in an email sent from the python script. I want to write a text and the table and repeat this for two more dataframes but the script is not able to attach more than one html block. The code is as follows: import numpy as np...
Akshay
1

votes
1

answer
4.8k

Views

HTTP: Illegal chunked encoding

I have a .NET client-application which uses a third-party library to access a server via http. The library throws the following error: The server committed a protocol violation. Section=ResponseBody Detail=Response chunk format is invalid The software is already installed dozens of times, so i think...
Hurby
1

votes
1

answer
602

Views

Python email - 8bit MIME support

I'm writing a simple MUA application, and I have a troubles with generating message. I want to my program automatically detect whether the SMTP server supports 8bit MIME, and if yes, then it'll generate a message, where the part with plain text will be encoded on 8bits. In MIME header it should look...
BartQ
0

votes
0

answer
6

Views

Java: get content of MIME multipart BodyPart

I'm trying to retrieve content of MIME multipart using BodyPart as follow ByteArrayOutputStream baos = null; MimeMultipart mp = new MimeMultipart(new ByteArrayDataSource(inputStream, contentType)); int count = mp.getCount(); baos = new ByteArrayOutputStream(); for (int i = 0; i < count; i++) { BodyP...
JackTheKnife
2

votes
1

answer
7.6k

Views

Set MIME type after PHP interpreting

When I use AddType application/x-httpd-php .phtml .pwml .php5 .php4 .php3 .php2 .php .inc .htm .html in httpd.conf, the files with the given extensions start being interpreted by PHP interpreter. But all of them also start having 'text/html' MIME type. I know I can use in the files themselves, but i...
noober
2

votes
0

answer
748

Views

how to change mimetype for executable text file

I am using linux slitaz 3.0 OS & pcmanfm 0.5.2 file manager. I have .mplayer/config file on my ext3 partition as $ls -l ~/.mplayer/config -rw-r--r-- 1 tux tux 94 Jun 14 20:38 /home/tux/.mplayer/config This file gets opened with gvim by default. If I copy this file to my ntfs part...
user1371666
2

votes
1

answer
1.3k

Views

Is there a maximum reasonable file size to attach to a MIME email with PHP?

I run PHP on IIS6. I have some PHP that successfully sends a 1KB image as an attachment on an email. When I try and attach a 500KB PDF however (having changed the Content-Type), it hangs and after a few minutes I get "FastCGI process exceeded configured request timeout" (Error Number 258 (0x800701...
Iain
3

votes
1

answer
555

Views

bash, getting the mime type of a file handle

How would i get the mime type of a file-handle without saving it to disk? What i mean is a file that is not saved to disk, rather: i extracted it from an archive and plan on piping it to another script. Say i extracted the file like this: tar -xOzf images.tar.gz images/logo.jpg | myscript Now insid...
dovidweisz
11

votes
2

answer
4k

Views

How to send a “multipart/related” with requests in python?

I'm trying to send a multipart/related message using requests in Python. The script seems simple enough, except that requests only seems to allow multipart/form-data messages to be sent, though their documentation does not clearly state this one way or another. My use case is sending soap with attac...
Zach Melnick
1

votes
3

answer
1.2k

Views

How can I use the MailKit ImapClient to read messages while it is in idle state?

I'm using IdleAsync to get notified about new emails. I want to get notified whenever a new message arrives and then read the message, but when I try to read the message, I am getting an exception that ImapClient is in idle state. Do I need create another ImapClient or can we use the same client t...
mahindar
1

votes
2

answer
7k

Views

Get MimeMessage Content as String

I have been searching and trying this so long i need your help. I have a server that gets HTML email. After that, i want to get the parts of it (header, subject and bodypart). Getting the header and subject is no problem, but the content is. So here's the code where i'm getting a SmtpMessage: privat...
Sundaze
2

votes
1

answer
2.1k

Views

Convert 8bit MIME message to quoted-printable

What is the easiest way to convert a MIME e-mail containing raw 8bit parts to a RFC822 compliant message containing only 7bit parts ? The parts have to be automatically converted to "Content-Transfer-Encoding: quoted-printable". My app is developed in Java. But a command-line tool would be great. I...
Antares

View additional questions