Hi...
In my application i like to provide file download facility. I set the file types to response.setContentType. How can I set the content types for almost all known file types? Is there any easy way? or I need to set it manually like i do now, which is given below.
if (pictureName.indexOf("jpg") > 0) {
re...
I'm working on some code that generates an Excel spreadsheet server-side and then downloads it to the user. I'm using ExcelPackage to generate the file.
The generation is working just fine. I can open the generated files using Excel 2007 with no issues. But, I'm having trouble downloading the file with Response.TransmitFile().
Right...
How can I change the type of all the files in a repository SVN who have the extension xml from the binary type to text.
I do not want to change the type of one file only but all files with extension .xml
...
I'm trying to understand how data gets passed around when using drag and drop in Qt. From what I understood from the examples I've been studying, you first define a widget as draggable by overriding methods inherited through QWidget.
In the implementation of the overridden method, the examples I've been looking at instantiate a pointer ...
What is the correct header information and MIME types for an email message with HTML content only, not mixed type (with both text and HTML).
Just to inform, I am using Swiftmailer (PHP) to this job.
...
What are the response content types for .docx, .xlsx, .pptx, .zip etc. ? Can you give me a list of all content types ?
...
This question, despite accepted-answer, was not answered. The reason it has an answer marked as accepted is because the bounty system, which I used, demands one. You are still welcome to answer this question if you know the answer (please do) - I will try to reputation-pay you in upvotes elsewhere. (Reputation purists may now throw rocks...
My Rails site allows users to upload documents, I am using the attachment_fu plugin. I have a list of allowed [MIME] content types that I allow - the standard image formats, Office documents, PDF, etc. I have a user who cannot upload any PDF documents because the validation fails, looking in the logs attachment_fu thinks the MIME type is...
hi people, my file form element is very simple:
$this->archivo = new Zend_Form_Element_File('archivo');
$this->archivo->setLabel('Archivo:')
->setRequired(true)
->setDestination(UPLOAD_PATH)
->addValidator('Count', false, 1)
->addValidator('Size', false, MAX_FILE_SIZE)
->addValidator('Extension', ...
In my Rails app I'm trying to get the MIME type of a file like so:
MIME::Types.type_for("example.m4v").to_s
But it's not recognizing it.
I tried adding the following to config/initializers/mime_types.rb (and restarted the server) without any luck:
Mime::Type.register "video/mp4", :m4v
...
It appears that calling Html.RenderAction in Asp.Net MVC2 apps can alter the mime type of the page if the child action's type is different than the parent action's.
The code below (testing in MVC2 RTM), which seems sensible to me, will return a result of type application/json when calling Home/Index. Instead of dispylaying the page, the...
I am trying to determine a file's mime type. I've tried a few methods, but haven't come up with anything that gives consistent output. I've tried $mime = mime_content_type($file) and $mime = exec('file -bi ' . $file). I am serving up images, CSS, and JavaScript.
Example mime_content_type() output:
jquery.min.js - text/plain
editor....
string fileName = "test.zip";
string path = "c:\\temp\\";
string fullPath = path + fileName;
FileInfo file = new FileInfo(fullPath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.Buffer = true;
Response.AppendHeader("content-dispositio...
This is not a real bug BUT for sure it is not what you would expect.
I have this sample code to upload images:
if($type=="image/jpg" || $type=="image/jpeg" || $type=="image/pjpeg" || $type=="image/tiff" || $type=="image/gif" || $type=="image/png") {
// make upload
else echo "Incorrect format ....";
The problem is that if I modify...
Firefox is issuing duplicate requests to my ASP.Net web site. It will request a page, get the response, then immediately issue the same request again (well, almost the same -- see below). This happens on every page of this particular Web site (but not any others). IE does not do this, but Chrome also does this.
I have confirmed that the...
It seems that a simple download of a PHP generated CSV file (with a vnd.ms-excel mime type for the sake of opening it with (Open)Office readly upon the "Save as..." dialog, when present) always gets the unwanted .xls extension when the UA is Google Chrome. The file would then be named as myfile.csv.xls. Firefox behaves correctly.
I wonde...
Is there a way to get a file's MIME type using some system call on Windows? I'm writing an IIS extension in C++, so it must be callable from C++, and I do have access to IIS if there is some functionality exposed. Obviously, IIS itself must be able to do this, but my googling has been unable to find out how. I did find this .net relat...
I'm trying to download an InfoPath template that's hosted on SharePoint. If I hit the url in internet explorer it asks me where to save it and I get the correct file on my disk. If I try to do this programmatically with WebClient or HttpWebRequest then I get HTML back instead.
How can I make my request so that the web server returns th...
I was serving html referencing svg files in Cassini, and having problems since the mime type was not being sent properly. I ended up writing my own port of Cassini that set the extension based on mime type.
After a good night of sleep I realized that there might be some sort of registry key or config file where I can configure custom mi...
I want the filter in a QFileDialog to match all audio file types supported by Phonon on the platform in question.
1 - However I am not able to find a way in Qt to use mime types in a filter. How can I do that?
2 - Or how can I find the corresponding file extensions for the mimetypes manually? The solution should be Qt based, or at leas...