FAQ Database Discussion Community


Send csv-file as attachment via MIMEBase - python

email,python-2.7,csv,mime-types,attachment
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:...

How to add a new MIME/Protocol handler to firefox and chrome in Ubuntu?

google-chrome,url,firefox,ubuntu,mime-types
So we created this application which handles a special protocol, now we want to open URLs that start with xpc:?mcd to be opened by a our application called mscdopen. For this we added a mscopen.desktop file to the /usr/share/application/ linking xpc to mscopen. We noticed that xgd-open works perfectly. Soif...

(ASP.NET MVC) Files Served in the Browser Have No Extension

asp.net-mvc,asp.net-mvc-3,asp.net-mvc-4,mime-types
I have the following code that serves the file to the user in the browser. The served file has no extension, and the users have to add the extension manually in order to open it. public ActionResult OpenDoc(int id = 0) { Document doc = dbContext.Documents.Single(d => d.DocID == id);...

jQuery File Upload, enable binary file upload

javascript,jquery,django,file-upload,mime-types
I am currently looking for an HTML5 and Javascript based file uploader and came across jQuery File Upload. jQuery File Upload seems to have everything I need. https://blueimp.github.io/jQuery-File-Upload/basic.html To quickly test jQuery File Upload capabilities in connection with Django I was lucky to find the "django-jquery-file-upload" project on GitHub. This...

Rails 4: savonrb > wasabi - Dependency conflict for mime-types version

mime-types,savon
I want to install the savon gem to parse some WSDLs. After including it in the Gemfile and running bundle install, it is giving the following message: Bundler could not find compatible versions for gem "mime-types": In Gemfile: savon (~> 2.8.0) ruby depends on wasabi (= 3.3.0) ruby depends on...

HTTP response returning status 0 when adding filemimetype validator to Zf2 form

php,validation,zend-framework,zend-framework2,mime-types
I had an error when i add filemimetype validator to my validator chain in one of my forms. I got an http status 0 and there aren't messages on Apache 2 logs. Does someone have an idea about what's happening? Here is the code: $fileInput->getValidatorChain() ->attachByName('filesize', ['max' => 1440000], false)...

Nginx - Wordpress blog on Rails loads styles and scripts with mime type text/html

php,ruby-on-rails,wordpress,nginx,mime-types
I just installed a Wordpress blog under a /blog directory within a Rails app, running on Unicorn and Nginx, and my stylesheets and scripts aren't being loaded properly in the browser when I go to my domain.com/blog pages. Chrome console's giving me the following error: Resource interpreted as Stylesheet but...

Problems with uploading some of PDF files in Laravel 5

pdf,file-upload,laravel-5,mime-types
I have an application based on Laravel 5 with file upload functionality. Everything works fine except uploading of some PDF files. The applications can not upload some of PDF files, and when I try to open them, they seems normal like any other PDF files. Any idea how to solve...

What are the accepted MIME content types for Google Cloud Storage (GCS)?

json,documentation,mime-types,google-cloud-storage,content-type
I have read the online documentation that I could find relating to uploading files to Google's Cloud Storage service (specifically the JSON api): https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload And on that page it references another page/doc to "See the API reference for each method's list of accepted MIME types and size limits for uploaded...

Chrome complains of MIME type wrong

browser,download,mime-types
I have created a simple PHP script which downloads files (sends them to the browser). The script sends the browser the type of document, for example MIME type "application/gz" for example document test.tar.gz However, on receiving the document Chrome complains: Resource interpreted as Document but transferred with MIME type application/gz...

Wordpress - get_post_mime_type

wordpress,mime-types
I'm showing a list of files on a page with there mime type. $type = get_post_mime_type( $document['document'] ); For a pdf it outputs 'application/pdf' Is it possible to remove the application and just show pdf....

Error reading MIME types using Python

python-2.7,mime-types
I'm writing a python script that will read file extensions, MIME types and file signatures so I can determine if any of those are missing or corrupt, and to establish the types of the files in the given directory. So far I've got: import magic, os def get_ext(dirPath): foldercount =...

Firefox fails to decompress gzip files

firefox,amazon-s3,http-headers,gzip,mime-types
I have .gz files stored on AWS s3. Using the s3 REST-API, I'm generating authenticated links that point to individual files. I'm also setting the content-header options such that browsers requesting these urls will decompress and download the gzipped files as attachments. The generated s3 url looks like so: https://MY_BUCKET.s3.amazonaws.com/PATH_TO/file.ext.gz...

RewriteRule can't read png dynamic image

regex,apache,.htaccess,mod-rewrite,mime-types
I've created a RewriteRule to allow a friendly url for signup in htaccess: RewriteRule ^signup$ signup.php It works everything fine, although a png image generated by a captcha field dinamically shows a broken link. If i run this script by raw signup.php request it works fine. The captcha source is...

Content-Type for Email Markup Actions

email,mime-types,content-type,schema.org,google-schemas
I've been looking at email Actions (which apparently are in a process of being standardized), and considering implementing these for an application of mine. However, the entire documentation seems to be missing the mime-type to define for the message part that includes this json-ld metadata. For example, gpg signatures are...

Android specific MIME type list?

android,mime-types
I have been asked to add a "share" method to one of my Android applications which allows users to share by 1) Facebook 2) SMS and 3) Email While researching, I have found that to allow users to select from "messaging" applications, I need to create the following Intent: Intent...

Error while getting file MIME type

c#,mime-types
I have used the code here to get the MIME type of file. AS public static string GetContentType(string fileName) { var extension = Path.GetExtension(fileName); if (String.IsNullOrWhiteSpace(extension)) { return null; } var registryKey = Registry.ClassesRoot.OpenSubKey(extension); if (registryKey == null) { return null; } var value = registryKey.GetValue("Content Type") as string; return...

Why doesn't the subtype of this custom MIME type specify the particular row (from Content URI) in the table?

android,uri,android-contentprovider,mime-types
AT the end of the developer guide, they have described vnd.android.cursor.dir to be the type part of every custom MIME type, for multiple rows; and vnd.android.cursor.item for a single row. Then there is an example of a Content Provider that contains train timetables. It's authority is com.example.trains and it has...

How to add multipart/mixed MIME boundary in Content-Type header in Swagger

mime-types,swagger,swagger-ui
In Swagger UI, is there a way to supply a MIME boundary that can be included in the Content-Type header? Using Swagger, I can generate / submit different content types in Swagger UI by using the consumes property in the Swagger Spec, e.g. application/json, application/xml, etc. However, I need to...

MIME type error

cakephp,mime-types
With Cakephp 2.6 I have the following warning: Can not determine the mimetype. Error: An Internal Error Has Occurred. Below is my Model: 'mimeType' => array( 'rule' => array('mimeType', array('image/gif', 'image/png', 'image/jpg', 'image/jpeg')), 'message' => 'Please only upload images (gif, png, jpg).', 'allowEmpty' => FALSE, ), In php.ini (\xampp\php\php.ini) I...

Some files are set as “application/octet-stream” type

php,mime-types
I have weird problem, that when I try to upload different files, some of them are recognized correctly, but some are not and are set as application/octet-stream when you check their type $_FILES['file_1']['type'] Debug Objects: png Debug Objects: image/png Debug Objects: php Debug Objects: application/octet-stream Debug Objects: rar Debug Objects:...

Confict between Angular JS $scope and the MIME content-type of an API http response?

json,angularjs,angularjs-scope,mime-types
I'm playing with an AngularJs app (I'm a completly newbie!) consuming an API REST with Slim PHP through $http (next step: $resource, I know). It all works fine when retrieving data from the API when the controller's written like this: angular .module("adminTaller", ['ngRoute']) ... .controller("CustomersListController", ['$http', function($http){ var ctrl =...

browser cant find background-image when uploaded to server?

javascript,jquery,css,svg,mime-types
When I run the following jQuery code, it works just fine, except that it cannot find the image. In developer tools on chrome I get a 404 error. jQuery: $('.pg-nav a, .pg-nav-img').hover( function() { $('.pg-nav a').css('color', '#0087CD'); $('.pg-nav-img').css('background-image', 'url(../images/page-nav-icon-blue.svg)') }, function() { $('.pg-nav a').css('color', ''); $('.pg-nav-img').css('background-image', '') }); Looking at...

Restlet Content Type Negotiation

java,mime-types,content-type,restlet,media-type
It's common for APIs to support various forms of content negotiation: Accept HTTP header on the Request, Content-Type HTTP header on the Request (although I don't think conforms to standards), and deriving the expected type from the file extension. I'd like my Restlet REST API to support all of these,...

get MIME type from Assets Library URL iOS

ios,objective-c,iphone,mime-types,alassetslibrary
I am trying to upload image, but in the post request I need to pass "Content-Type" i.e the mime type of the image which I have picked from iOS Photo library, but when I am trying to get the mime type it is coming nil. Here is the process :-...

Is the application/octet-stream MIME type safe for uploading?

php,file-upload,mime-types
We have a server side PHP script to handle file uploads from an Android app. This script identifies the mime type of AMR files as application/octet-stream. We have an array containing some MIME types that script uses to check whether the file is safe or not. I'm not sure whether...

“Content-Type not allowed” while uploading an SVG file, that is in the allowed whitelist

file-upload,svg,struts2,mime-types,struts2-convention-plugin
IMPORTANT: The following problem has been fixed in Struts version 2.3.24. From that version on, there is no need to escape any character. Read more: JIRA Issue WW-4457. I've configured the Struts2 FileUpload Interceptor to allow a whitelist of Content-Types. This works correctly with any file matching the Content-Type...

Starting a specific activity through NFC tag

android,nfc,mime-types,intentfilter,ndef
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: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.km.parkit"...

Getting “filetype not allowed” with Codeigniter upload

php,codeigniter,file-upload,upload,mime-types
First of all, there are already a lot of (solved) questions regarding this topic. And I tried all possible solutions. But to no avail. The problem occurs in both CI versions 2.1.4 and 2.2.1. I also tried using different filetypes, such as png,gif and txt. I've done no mime-type alterations,...

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

html5,video,mime-types,mp4,webm
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...

How to check mime type and upload in different dir

php,codeigniter,upload,mime-types
private $uploadhost = "http://my.domain.com/"; function upload() { date_default_timezone_set('Europe/Berlin'); $key = "mykey"; $redirect = "http://domain.com"; $Date = date("Y-m-d_H-i-s"); if ($_SERVER["REQUEST_URI"] == "/robot.txt") { die("User-agent: *\nDisallow: /"); } if ($this->input->post('key')) { if ($this->input->post('key') == $key) { $target = getcwd() . "/r/" . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) { $filename = explode(".", $_FILES["file"]["name"]); $filename...

eBay LMS uploadFile - Cannot specify file with valid format

python,mime-types,ebay-api,ebay-lms,xop
I am attempting to use the eBay Large Merchant Services API to upload calls in bulk. This API and documentation are notoriously bad (I found a blog post that explains it and rails against it here). The closest I can find to a working Python solution is based on this...

How to serve woff2 files from owin FileServer

mime-types,owin,font-awesome,fileserver,woff2
Since font awesome 4.3, they added the fonts as woff2 format. I'm guetting 404ed when trying to serve this file through owin : app.UseFileServer(new FileServerOptions() { RequestPath = PathString.Empty, FileSystem = new PhysicalFileSystem(@"banana") }); How do I serve woff2 mime type files through file server in owin ?...