Search Results

Search found 219 results on 9 pages for 'mimetype'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • MFMailComposeViewController configure mimetype for attachment

    - by user749918
    I need some help. I am trying to attach files to mail using, [mail addAttachmentData:attachmentData mimeType:@"image/png" fileName:fileName]; but the problem is that if i need to send a .jpeg image i need to repeat code just for setting mime type to "mimeType:@"image/jpeg". My question is that is there any general mimeType that can attach any kind of file irrespective of .doc,.ppt,.pdf or an audio or video file. is there any general mimeType: for an kind of attachment. Thanks in advance.

    Read the article

  • Adding Silverlight MimeType using adsutil

    - by Rich
    I have a script that creates an app pool, web site - and then I want to use adsutil to add the .xap MimeType. I see this: cscript adsutil.vbs set W3SVC//Root/MimeMap “.extension,mimetype” However, since I am creating the web site in the same script I will not know the ID. Would anyone know how to do this with adsutil? Thanks, Rich

    Read the article

  • Ubuntu: Getting rid of a mimetype entry

    - by Epaga
    I have a pesky mimetype entry that I can't seem to get rid of. Here is the current situation: xdg-mime query filetype myfile.mfe application/pesky Using assogiate I have found out the information about this mime type entry (but can't delete it there). I have the following 'pesky.xml' XML file which was used to create the mime type (as far as I can tell, since it exactly matches the entry in assogiate...): <?xml version='1.0'?> <mime-info xmlns='http://www.freedesktop.org/standard'> <mime-type type="application/pesky"> <comment>my pesky type</comment> <glob pattern="*.mfe"/> <magic priority="100"> <match type="string" offset="0" value="application/pesky"/> </magic> </mime-type> <mime-info> However, the following has no effect: sudo xdg-mime uninstall --mode system --novendor pesky.xml The file association remains. Any ideas?

    Read the article

  • Sending most correct mimetype

    - by Roland Franssen
    Hi all, I have a list of extension to mimetype in a INI file. However some extensions have multiple mimetypes, for example; midi[] = "application/x-midi" midi[] = "audio/midi" midi[] = "audio/x-mid" midi[] = "audio/x-midi" midi[] = "music/crescendo" midi[] = "x-music/x-midi" 6 (possible) mimetypes for 1 extension. Whats common practice to determine the correct mimetype? (e.g. i need to set a HTTP content-type header). I know its not ideal; determining mimetypes based on extension.. but i need consistent (cross-server) results (e.g. fileinfo extension in PHP is making terrible guesses*). * Some fileinfo results for example; js - text/plain css - text/c-h

    Read the article

  • Zend_Form - The mimetype of file 'foto.jpg' could not be detected

    - by vian
    I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' => false, 'label' => 'Venue Image', 'validators' => array( array('IsImage', false), array('Size', false, '2097152'), array('Upload', false), ), )) And when I'm using localhost the image is uploaded successfully. But when I move to my hosting the validation error shows for image field. The mimetype of file 'foto.jpg' could not be detected. What can be the reason of this?

    Read the article

  • Flex SDK 3.5 - Check file mimetype

    - by Fernando
    Is there a way to get a file's mimetype in Flex SDK 3.5 without using its extension? I need to validate if an uploaded file is of a certain kind. This is for images, or documents (PDF, ODT, etc.) All the solutions I've found are by checking its extension. What if I rename a .odt file as a .jpg? Then I can upload it as an image... I should add, we are using an AIR desktop client and a Java EE server. File checking is solved on the Java side, but the idea is not to go to the server, validate the file so if it's not valid, there's no network traffic at all.

    Read the article

  • mEncrypt/Decrypt binary mp3 with mcrypt, missing mimetype

    - by Jeremy Dicaire
    I have a script that read a mp3 file and encrypt it, I want to be able to decrypt this file and convert it to base64 so it can play in html5. Key 1 will be stored on the page and static, key2 will be unique for each file, for testing I used: $key1 = md5(time()); $key2 = md5($key1.time()); Here is my encode php code : //Get file content $file = file_get_contents('test.mp3'); //Encrypt file $Encrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key1, $file, MCRYPT_MODE_CBC, $key2); $Encrypt = trim(base64_encode($Encrypt)); //Create new file $fileE = "test.mp3e"; $fileE = fopen($file64, 'w') or die("can't open file"); //Put crypted content fwrite($fileE, $Encrypt); //Close file fclose($fileE); Here is the code that doesnt work (decoded file is same size, but no mimetype): //Get file content $fileE = file_get_contents('test.mp3e'); //Decode $fileDecoded = base64_decode($fileE); //Decrypt file $Decrypt = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $fileDecoded, MCRYPT_MODE_CBC, $key2); $Decrypt = trim($Decrypt); //Create new file $file = "test.mp3"; $file = fopen($file, 'w') or die("can't open file"); //Put crypted content fwrite($file, $Decrypt); //Close file fclose($file);

    Read the article

  • Compressing a web service response for jQuery

    - by SirDemon
    I'm attempting to gzip a JSON response from an ASMX web service to be consumed on the client-side by jQuery. My web.config already has httpCompression set like so: (I'm using IIS 7) <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" staticCompressionDisableCpuUsage="90" staticCompressionEnableCpuUsage="60" dynamicCompressionDisableCpuUsage="80" dynamicCompressionEnableCpuUsage="50"> <dynamicTypes> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="text/css" enabled="true" /> <add mimeType="video/x-flv" enabled="true" /> <add mimeType="application/x-shockwave-flash" enabled="true" /> <add mimeType="text/javascript" enabled="true" /> <add mimeType="text/*" enabled="true" /> <add mimeType="application/json; charset=utf-8" enabled="true" /> </dynamicTypes> <staticTypes> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="text/css" enabled="true" /> <add mimeType="video/x-flv" enabled="true" /> <add mimeType="application/x-shockwave-flash" enabled="true" /> <add mimeType="text/javascript" enabled="true" /> <add mimeType="text/*" enabled="true" /> </staticTypes> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> </httpCompression> <urlCompression doDynamicCompression="true" doStaticCompression="true" /> Through fiddler I can see that normal aspx and other compressions work fine. However, the jQuery ajax request and response work as they should, only nothing gets compressed. What am I missing?

    Read the article

  • How do I compress a Json result from ASP.NET MVC with IIS 7.5

    - by Gareth Saul
    I'm having difficulty making IIS 7 correctly compress a Json result from ASP.NET MVC. I've enabled static and dynamic compression in IIS. I can verify with Fiddler that normal text/html and similar records are compressed. Viewing the request, the accept-encoding gzip header is present. The response has the mimetype "application/json", but is not compressed. I've identified that the issue appears to relate to the MimeType. When I include mimeType="*/*", I can see that the response is correctly gzipped. How can I get IIS to compress WITHOUT using a wildcard mimeType? I assume that this issue has something to do with the way that ASP.NET MVC generates content type headers. The CPU usage is well below the dynamic throttling threshold. When I examine the trace logs from IIS, I can see that it fails to compress due to not finding a matching mime type. <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" noCompressionForProxies="false"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/json" enabled="true" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> <add mimeType="application/json" enabled="true" /> </staticTypes> </httpCompression>

    Read the article

  • How to change mimetype image for PSD file (Photoshop)?

    - by ubuntico
    Following this link https://help.ubuntu.com/community/AddingMimeTypes, I first typed a command to discover the mimetype for psd extension ~$ grep 'psd' /etc/mime.types image/x-photoshop psd Then I took Photoshop CS5 SVG image from Wikipedia and renamed it to image-x-photoshop.svg. Then I copied the file to the folder /usr/share/icons/gnome/scalable via command sudo cp image-x-photoshop.svg /usr/share/icons/gnome/scalable/image-x-photoshop.svg Loogged out, logged in, but the icon for the .psd files is still unchanged. Does anyone know what I am doing wrong? I use Ubuntu 10.10. Thanks in advance

    Read the article

  • how should I change the representation (not mimetype) of a resource?

    - by xenoterracide
    I'm looking at how I can change the representation of a payload at runtime for varied potential advantages, but I'm not sure how to do it. Specifically collections. Array of Pairs [{ <resource_uri> : { <entity> }, ...}] Array of Objects [<entity>,...] Array of Resources [<resource_uri>] Map of entities { <resource_uri> : { <entity> }, ... } My problem is, I'm not sure if I should put these different representations of the sets at different URI's, give them slightly varied mime types, e.g. application/foomap+json or perhaps use an optional query parameter ?format=map, or resource /entities/map. The UI is going to hide this, this is for programmatic web service access only (which the "UI's JS will have to call).

    Read the article

  • How do you ensure a mimetype in asp.net?

    - by Sem Dendoncker
    Hello, I have the following code to export a zip file: byte[] buffer = FileUtil.FileToByteArray(zipLocation, true); // push the memory data to the client. _ctx.Response.ContentType = "application/zip"; _ctx.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", String.Format("map{0}.zip", mapId))); _ctx.Response.BinaryWrite(buffer); This code works great. After every export I get a perfectly made zipfile. The problem however is that when I try to import it, the mimetype sometimes is "application/empty". Now I wonder how can I ensure that the mimetype is always added? Cheers, M.

    Read the article

  • how to enable iis 7 dynamic content compression?

    - by davidcl
    I've turned on dynamic content compression in IIS 7, but Fiddler is showing that my dynamic pages are still being served without content-encoding: gzip. Static content compression is working fine on the same servers. Not sure if it matters but most of the dynamic pages are coldfusion pages and we're also using the IIS URL rewriting module. This is from my applicationhost.config. <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> ... <urlCompression doDynamicCompression="true" /> Here's a sample request: GET / HTTP/1.1 Host: web5.example.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive and response header: HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/7.0 ... Date: Mon, 22 Feb 2010 20:59:36 GMT

    Read the article

  • IIS7 Compression CSS files only compressed when dynamic compression is enabled

    - by Paul
    If anyone can help it would be appreciated. I would like to enable compression for static files within IIS7 (for the sake of simplicity I'll just refer to static css files for the time being). The problem I'm getting is that css files are only compressed when both dynamic and static compression is enabled in IIS for the website. What I really want to achieve is css compression (static file) whilst leaving the dynamic (aspx) pages as uncompressed for the time being (to avoid unnecessary CPU load). I am puzzled as to why just leaving 'static compression' enabled causes css files to be returned uncompressed. My applicationHost.config file has not be altered and looks like this: <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> </httpCompression> The server-wide compression setting within IIS is set to 'Dynamic Disabled' and 'Static Enabled' from the Server Features Compression page. The web-site compression setting (Server Sites MyWebsite Features Compression) is where I am enabling and disabling dynamic compression as detailed above. Any help would be really help me get unstuck on this. Thanks

    Read the article

  • Why does my javascript file sometimes compressed while sometimes not?(IIS Gzip problem)

    - by Kevin Yang
    i enable gzip for javascript file in my iis settings, here 's the corresponding config section. <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="10" dynamicCompressionLevel="8" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/soap+msbin1" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> currently, when i download my js file, it seems that sometimes server return the gzip one, and sometimes not. i dont know why, and how to debug that. If a file is already gzipped, it should be cached in local disk, and next time someone visit that file again, iis kernel should return the cache gzip file directly without compressing it again. Is that right?

    Read the article

  • Gzip http compression problem on iis7

    - by wpfwannabe
    My web hosting provider is running IIS7 and I am having loads of trouble to get gzip compression to work properly. Host admins say compression is installed. I can confirm compression using some online checking services but not with others. PageSpeed Firefox add-on also says the site is uncompressed. I am personally sitting behind a Squid proxy but web.config settings should take care of proxy issue. Below is the relevant web.config snippet. Most of it is borrowed from various sites. Any thoughts? <urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" doStaticCompression="true" /> <httpCompression cacheControlHeader="max-age=86400" noCompressionForHttp10="False" noCompressionForProxies="False" sendCacheHeaders="True" dynamicCompressionEnableCpuUsage="89" dynamicCompressionDisableCpuUsage="90" minFileSizeForComp="1" noCompressionForRange="False"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression>

    Read the article

  • Built-in GZip/Deflate Compression on IIS 7.x

    - by Rick Strahl
    IIS 7 improves internal compression functionality dramatically making it much easier than previous versions to take advantage of compression that’s built-in to the Web server. IIS 7 also supports dynamic compression which allows automatic compression of content created in your own applications (ASP.NET or otherwise!). The scheme is based on content-type sniffing and so it works with any kind of Web application framework. While static compression on IIS 7 is super easy to set up and turned on by default for most text content (text/*, which includes HTML and CSS, as well as for JavaScript, Atom, XAML, XML), setting up dynamic compression is a bit more involved, mostly because the various default compression settings are set in multiple places down the IIS –> ASP.NET hierarchy. Let’s take a look at each of the two approaches available: Static Compression Compresses static content from the hard disk. IIS can cache this content by compressing the file once and storing the compressed file on disk and serving the compressed alias whenever static content is requested and it hasn’t changed. The overhead for this is minimal and should be aggressively enabled. Dynamic Compression Works against application generated output from applications like your ASP.NET apps. Unlike static content, dynamic content must be compressed every time a page that requests it regenerates its content. As such dynamic compression has a much bigger impact than static caching. How Compression is configured Compression in IIS 7.x  is configured with two .config file elements in the <system.WebServer> space. The elements can be set anywhere in the IIS/ASP.NET configuration pipeline all the way from ApplicationHost.config down to the local web.config file. The following is from the the default setting in ApplicationHost.config (in the %windir%\System32\inetsrv\config forlder) on IIS 7.5 with a couple of small adjustments (added json output and enabled dynamic compression): <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/json" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> <urlCompression doStaticCompression="true" doDynamicCompression="true" /> </system.webServer> </configuration> You can find documentation on the httpCompression and urlCompression keys here respectively: http://msdn.microsoft.com/en-us/library/ms690689%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/aa347437%28v=vs.90%29.aspx The httpCompression Element – What and How to compress Basically httpCompression configures what types to compress and how to compress them. It specifies the DLL that handles gzip encoding and the types of documents that are to be compressed. Types are set up based on mime-types which looks at returned Content-Type headers in HTTP responses. For example, I added the application/json to mime type to my dynamic compression types above to allow that content to be compressed as well since I have quite a bit of AJAX content that gets sent to the client. The UrlCompression Element – Enables and Disables Compression The urlCompression element is a quick way to turn compression on and off. By default static compression is enabled server wide, and dynamic compression is disabled server wide. This might be a bit confusing because the httpCompression element also has a doDynamicCompression attribute which is set to true by default, but the urlCompression attribute by the same name actually overrides it. The urlCompression element only has three attributes: doStaticCompression, doDynamicCompression and dynamicCompressionBeforeCache. The doCompression attributes are the final determining factor whether compression is enabled, so it’s a good idea to be explcit! The default for doDynamicCompression='false”, but doStaticCompression="true"! Static Compression is enabled by Default, Dynamic Compression is not Because static compression is very efficient in IIS 7 it’s enabled by default server wide and there probably is no reason to ever change that setting. Dynamic compression however, since it’s more resource intensive, is turned off by default. If you want to enable dynamic compression there are a few quirks you have to deal with, namely that enabling it in ApplicationHost.config doesn’t work. Setting: <urlCompression doDynamicCompression="true" /> in applicationhost.config appears to have no effect and I had to move this element into my local web.config to make dynamic compression work. This is actually a smart choice because you’re not likely to want dynamic compression in every application on a server. Rather dynamic compression should be applied selectively where it makes sense. However, nowhere is it documented that the setting in applicationhost.config doesn’t work (or more likely is overridden somewhere and disabled lower in the configuration hierarchy). So: remember to set doDynamicCompression=”true” in web.config!!! How Static Compression works Static compression works against static content loaded from files on disk. Because this content is static and not bound to change frequently – such as .js, .css and static HTML content – it’s fairly easy for IIS to compress and then cache the compressed content. The way this works is that IIS compresses the files into a special folder on the server’s hard disk and then reads the content from this location if already compressed content is requested and the underlying file resource has not changed. The semantics of serving an already compressed file are very efficient – IIS still checks for file changes, but otherwise just serves the already compressed file from the compression folder. The compression folder is located at: %windir%\inetpub\temp\IIS Temporary Compressed Files\ApplicationPool\ If you look into the subfolders you’ll find compressed files: These files are pre-compressed and IIS serves them directly to the client until the underlying files are changed. As I mentioned before – static compression is on by default and there’s very little reason to turn that functionality off as it is efficient and just works out of the box. The one tweak you might want to do is to set the compression level to maximum. Since IIS only compresses content very infrequently it would make sense to apply maximum compression. You can do this with the staticCompressionLevel setting on the scheme element: <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" /> Other than that the default settings are probably just fine. Dynamic Compression – not so fast! By default dynamic compression is disabled and that’s actually quite sensible – you should use dynamic compression very carefully and think about what content you want to compress. In most applications it wouldn’t make sense to compress *all* generated content as it would generate a significant amount of overhead. Scott Fortsyth has a great post that details some of the performance numbers and how much impact dynamic compression has. Depending on how busy your server is you can play around with compression and see what impact it has on your server’s performance. There are also a few settings you can tweak to minimize the overhead of dynamic compression. Specifically the httpCompression key has a couple of CPU related keys that can help minimize the impact of Dynamic Compression on a busy server: dynamicCompressionDisableCpuUsage dynamicCompressionEnableCpuUsage By default these are set to 90 and 50 which means that when the CPU hits 90% compression will be disabled until CPU utilization drops back down to 50%. Again this is actually quite sensible as it utilizes CPU power from compression when available and falling off when the threshold has been hit. It’s a good way some of that extra CPU power on your big servers to use when utilization is low. Again these settings are something you likely have to play with. I would probably set the upper limit a little lower than 90% maybe around 70% to make this a feature that kicks in only if there’s lots of power to spare. I’m not really sure how accurate these CPU readings that IIS uses are as Cpu usage on Web Servers can spike drastically even during low loads. Don’t trust settings – do some load testing or monitor your server in a live environment to see what values make sense for your environment. Finally for dynamic compression I tend to add one Mime type for JSON data, since a lot of my applications send large chunks of JSON data over the wire. You can do that with the application/json content type: <add mimeType="application/json" enabled="true" /> What about Deflate Compression? The default compression is GZip. The documentation hints that you can use a different compression scheme and mentions Deflate compression. And sure enough you can change the compression settings to: <scheme name="deflate" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" /> to get deflate style compression. The deflate algorithm produces slightly more compact output so I tend to prefer it over GZip but more HTTP clients (other than browsers) support GZip than Deflate so be careful with this option if you build Web APIs. I also had some issues with the above value actually being applied right away. Changing the scheme in applicationhost.config didn’t show up on the site  right away. It required me to do a full IISReset to get that change to show up before I saw the change over to deflate compressed content. Content was slightly more compressed with deflate – not sure if it’s worth the slightly less common compression type, but the option at least is available. IIS 7 finally makes GZip Easy In summary IIS 7 makes GZip easy finally, even if the configuration settings are a bit obtuse and the documentation is seriously lacking. But once you know the basic settings I’ve described here and the fact that you can override all of this in your local web.config it’s pretty straight forward to configure GZip support and tweak it exactly to your needs. Static compression is a total no brainer as it adds very little overhead compared to direct static file serving and provides solid compression. Dynamic Compression is a little more tricky as it does add some overhead to servers, so it probably will require some tweaking to get the right balance of CPU load vs. compression ratios. Looking at large sites like Amazon, Yahoo, NewEgg etc. – they all use Related Content Code based ASP.NET GZip Caveats HttpWebRequest and GZip Responses © Rick Strahl, West Wind Technologies, 2005-2011Posted in IIS7   ASP.NET  

    Read the article

  • GZip compression with WCF hosted on IIS7

    - by joniba
    So I'm going to add my query to the small ocean of questions on the subject. I'm trying to enable GZip compression on large soap responses from a WCF service. So far, I've followed instructions here and in a variety of other places to enable dynamic compression on IIS. Here's my dynamicTypes section from the applicationHost.config: <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> <add mimeType="application/xop+xml" enabled="true" /> <add mimeType="application/soap+xml" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> And also: <urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" /> Though I'm not so clear on why that's needed. Threw some extra mime-types in there just in case. I've implemented IClientMessageInspector to add Accept-Encoding: gzip, deflate to my client's HttpRequests. Here's an example of a request-header taken from fiddler: POST http://[omitted]/TestMtomService/TextService.svc HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Accept-Encoding: gzip, deflate Host: [omitted] Content-Length: 542 Expect: 100-continue Now, this doesn't work. There's simply no compression happening, no matter what the size of the message (tried up to 1.5Mb). I've looked at this post, but have not run into an exception as he describes, so I haven't tried the CodeProject implementation that he proposes. Also I've seen a lot of other implementations that are supposed to get this to work, but cannot make sense of them (e.g., msdn's GZip encoder). Why would I need to implement the encoder, or the code-project solution? Shouldn't IIS take care of the compression? So what else do I need to do to get this to work? Joni

    Read the article

  • Can't download file in IE7 but there isn't any problem in Firefox, Chrome, etc..?

    - by levhita
    I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this: $MimeType = new MimeType(); $mimetype = $MimeType->getType($filename); $basename = basename($filename); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=\"$basename\""); header('Content-Length: '. filesize($filename)); if ( @readfile($filename)===false ) { header("HTTP/1.0 500 Internal Server Error"); loadErrorPage('500'); } Downloads works as charm in any Browser except IE, I have seen problems related to 'no-cache' headers but I don't send anything like that, they talk about utf-8 characters, but there is not any utf-8 characters(and the $filename has not any utf-8 characteres neither).

    Read the article

  • IIS7 Compression

    - by Thomas
    Hi Guys, I have searched around and havent really found an answer anywhere and this is still not working for me. I am using compression in IIS7 and it doesn't appear to be working. The code I am using is per <urlCompression doStaticCompression="true" /> <httpCompression cacheControlHeader="max-age=86400" sendCacheHeaders="true" expiresHeader="true" minFileSizeForComp="0" directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> However my content is still not being gzipped ? Any ideas why this is happening ? Cheers

    Read the article

  • ASP.NET MVC FileContentResult IE 8.0 hangs on download

    - by marc.d
    some of my users are expieriencing problems when they try to download a report, the download just hangs on 0%, restarting IE usually fixes the problem. why does this happen? i am using ASP.NET MVC (v1), the my action looks like this <Authorize()> _ <AcceptVerbs(HttpVerbs.Get)> _ Function RenderReport(ByVal guid As Guid, ByVal anonym As Boolean) As FileContentResult ... Dim mimeType As String = String.Empty Dim renderedBytes() As Byte = EmployeePresentation.Render(guid, mimeType, Server.MapPath("~/Reports/..."), anonym) Return File(renderedBytes, mimeType, filename) End Function the filename is US-ASCII encoded, filesize is usally around 300Kb, mimeType is application/pdf tia

    Read the article

  • Displaying ppt, doc, and xls in UIWebView doesn't work but pdf does

    - by slugolicious
    It looks like a few people on stackoverflow get this to work but their code isn't posted. I'm using [web loadData:data MIMEType:MIMEType textEncodingName:@"UTF-8" baseURL:nil]; where MIMEType is: @"application/vnd.ms-powerpoint" @"application/vnd.ms-word" @"application/vnd.ms-excel" (BTW, I've seen DOC files use mimetype @"application/msword" but the "vnd" version seems more appropriate. I tried both just in case.) I verified that my 'data' is correct. PDF and TXT files work. When the UIWebView displays PPT, DOC, or XLS files, it's blank. I put NSLOG statements in my UIWebViewDelegate calls. shouldStartLoadWithRequest:<NSMutableURLRequest about:blank> navType:5 webViewDidStartLoad: didFailLoadWithError:Error Domain=NSURLErrorDomain Code=100 UserInfo=0x122503a0 "Operation could not be completed. (NSURLErrorDomain error 100.)" didFailLoadWithError:Error Domain=WebKitErrorDomain Code=102 UserInfo=0x12253840 "Frame load interrupted" so obviously the load is failing, but why? If I change my mimetype to @"text/plain" for a PPT file, the UIWebView loads fine and displays unprintable characters, as expected. That's telling me the 'data' passed to loadData: is ok. Meaning my mimetypes are bad? And just to make sure my PPT, DOC, and XLS files are indeed ok to display, I created a simple html file with anchor tags to the files. When the html file is displayed in Safari on the iPhone, clicking on the files displays correctly in Safari. I tried to research the error code displayed in didFailLoadWithError (100) but all the documented error codes are negative and greater than 1000 (as seen in NSURLError.h). -(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { NSLog(@"didFailLoadWithError:%@", error); }

    Read the article

  • Flex special characters not embedding

    - by Hanpan
    Hi, I am using the following code to embed Arial into my application: [Embed(source='../assets/fonts/Arial.ttf',fontFamily='CustomFont',fontWeight='regular', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC', mimeType='application/x-font-truetype' )] public static var MY_FONT:Class; [Embed(source='../assets/fonts/Arial Bold.ttf',fontFamily='CustomFont',fontWeight='bold', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC', mimeType='application/x-font-truetype' )] public static var MY_FONT_BOLD:Class; [Embed(source='../assets/fonts/Arial Italic.ttf',fontFamily='CustomFont',fontWeight='regular',fontStyle="italic", unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC', mimeType='application/x-font-truetype' )] public static var MY_FONT_ITALIC:Class; [Embed(source='../assets/fonts/Arial Bold Italic.ttf',fontFamily='CustomFont',fontWeight='bold',fontStyle="italic", unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC', mimeType='application/x-font-truetype' )] public static var MY_FONT_ITALIC_BOLD:Class; [Embed(source='../assets/fonts/Arial Unicode.ttf',fontFamily='CustomFont',fontWeight='regular', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC', mimeType='application/x-font-truetype' )] public static var MY_FONT_UNICODE:Class; It's working fine for foreign characters, but no special characters (copyright, trademark, euro sign etc) are working. Can anyone help? I've checked my unicode ranges, they should work fine!

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >