Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Not sure if this should be posted here. List of Content-type: definitions?  (Read 1356 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
A couple of my projects have made me realize that it might just be simpler to byte the bullet and make a webserver from scratch. 

A slight snag I've been having are the "Content-type:" definitions you need to supply when sending along a file.  There are various lists out there, but most are either incomplete or aren't very copy/paste friendly. 

Any of you guys have a good list or a link to a good one?

spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
I've run LAMP for years with downloads and have never worried about content-type that I can recall.  What specific snag are you hitting?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Not a snag per say... it's just that android, particularly the older versions, seems to be quite picky.  It'll try to download and save things as a file that should normally be displayed in browser.  It seems to be an android exclusive problem, but I'll bet other non-standard browsers are going to have issues as well.  I've got all of the common ones hooked up, but I'd like to just be done with it and lookup from a list. 

spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
Ah, have not pissed around with Android at all.  Bought a book to help program a game on one.......then saw game already existed..........haven't looked back.   :P

twistedsymphony

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 584
  • Last login:February 03, 2024, 11:13:51 pm
  • Play stupid games... win stupid prizes.
    • solid-orange.com
    • CollectorsEdition.org
Re: Not sure if this should be posted here. List of Content-type: definitions?
« Reply #4 on: February 05, 2014, 09:38:44 am »
Not a snag per say... it's just that android, particularly the older versions, seems to be quite picky.  It'll try to download and save things as a file that should normally be displayed in browser.  It seems to be an android exclusive problem, but I'll bet other non-standard browsers are going to have issues as well.  I've got all of the common ones hooked up, but I'd like to just be done with it and lookup from a list. 

I'm not sure if you ever got this working but you'll want to leave content-type as it is. to force download you'll need to set "Content-Disposition: attachment;" in the header...

alternatively you can force set this for certain file types in the apache config:
Code: [Select]
<FilesMatch "\.(?i:doc|odf|pdf|rtf|txt)$">
  Header set Content-Disposition attachment
</FilesMatch>


This is the proper way to do this, but sometimes the browser still ignores it.
« Last Edit: February 05, 2014, 09:45:32 am by twistedsymphony »

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Not sure if this should be posted here. List of Content-type: definitions?
« Reply #5 on: February 05, 2014, 09:56:13 pm »
You want this:
http://en.wikipedia.org/wiki/Internet_media_type

What the heck projects are making you need to create a web server? :)

edit: forgot to mention.. in Android it is on an app to say whether or not they handle certain MIME types.. particularly older Android web browsers didn't handle all of them - so you will run into that issue. If anyone is using an older version of Android, they should probably not be using the stock web browser.
« Last Edit: February 05, 2014, 10:07:29 pm by liquid8 »