Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:43:20+00:00 2026-06-04T05:43:20+00:00

I am currently working on a PHP script that allows you to download media

  • 0

I am currently working on a PHP script that allows you to download media contents (video, audio, pictures…) from your mobile device by accessing a link. (i.e. http://www.my-web-site.com/download.php?id=7ejs8ap)
My script worked very vell when I was testing it with recent mobile (Samsung Galaxy S, iPhone 4S, some others…) but an error occured on my old mobile Samsung C3050. The media I wanted to download was just an audio mp3 file that I usually download easily.

The error appears to be “Unknown content type.”
So, as my only HTTP header Content-Type was “application/force-download”, I try to comment this and try again. Then, it works.
But now, I am currently asking what this Content-Type means and if it can be mandatory for others mobile. I tested without the Content-Type on the iPhone 4 and it works, but I’m not sure of this compatibility for all mobile.

Can someone explain me how that Content-Type works, why this isn’t a standard MIME or everything else that can help me to be sure this is an optionnal Content-Type for every download, whatever the file, the browser or the device I am downloading on?

Thanks everyone.

Here is my PHP headers sent:

<?php
//Assume that $filename and $filePath are correclty set.
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$filename.'"');
// header('Content-Type: application/force-download'); Non-standard MIME-Type, incompatible with Samsung C3050 for example. Let it commented
readfile($filePath);
?>

EDIT : I just tried with a Sony Xperia, and the download wasn’t successful: I only see the “html-encoded” bytes of my file I want to download.
How can I know what content-type I have to use if application/octet-stream or application/force-download doesn’t work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:43:22+00:00Added an answer on June 4, 2026 at 5:43 am

    Content-Type: application/force-download means “I, the web server, am going to lie to you (the browser) about what this file is so that you will not treat it as a PDF/Word Document/MP3/whatever and prompt the user to save the mysterious file to disk instead”. It is a dirty hack that breaks horribly when the client doesn’t do “save to disk”.

    Use the correct mime type for whatever media you are using (e.g. audio/mpeg for mp3).

    Use the Content-Disposition: attachment; etc etc header if you want to encourage the client to download it instead of following the default behaviour.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a PHP/MySQL script that does the following, in this order:
I'm having some problems with the php script below that I'm currently working on.
I am currently working on a php application that allows for users to schedule
I am currently working on a PHP script that will be polling Active Directory
We currently have a working php mail script, this works fine and as we
I'm currently working on a PHP application that uses a MySQL database for its
I am currently working on a PHP application that puts me in the desperate
I am working on a PHP script that needs to read log files in
I am currently working on a php/javascript project which retrieves information from a database
I'm working on a PHP search script that scans a text file repository of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.