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

  • SEARCH
  • Home
  • 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 7828951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:33:30+00:00 2026-06-02T10:33:30+00:00

Im using X-Sendfile to send a file instead of readfile. The script processing this,

  • 0

Im using X-Sendfile to send a file instead of readfile. The script processing this, is named download.php and contains this:

$video_file = '/path/to/file/file.mp4';
header('X-Sendfile: '.$video_file);
header('Content-Type: video/mp4');
header('Content-Disposition: attachment; file=\"file.mp4\"');
exit();

But problem is that the downloaded file is always named “download.php” (155Mb), and i would like to download it named as file.mp4. Ive tried several things like:

header('Content-Disposition: attachment; file="file.mp4"');
header('Content-Disposition: attachment; file=file.mp4');

And all other posibilities, but still downloading the file as download.php.

My htaccess file contains: XSendFile On

  • 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-02T10:33:34+00:00Added an answer on June 2, 2026 at 10:33 am

    You are sending an incorrect header. The filename property is called filename, not name:

    header('Content-Disposition: attachment; filename="file.mp4"');
    

    See RFC2616 for a detailed description of the header.

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

Sidebar

Related Questions

I need to send a file to a web service (ebridge) using their SendFile
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
So - I've been using this method of file uploading for a bit, but
On Firefox 3.6 and Chrome, using xhr.send(file) just puts the raw contents into the
I am using the send_file method to download a file. It works fine on
The code I am using: In view file: <%= link_to Download, download_image_path(image) %> In
I am using paperclip for attachments when i download file, it got corrupted. File
I'm trying to send a file to the user using xsendfile within the code
Using Flex 3, I would like to take an image snapshot such as this:
Using PHP, I can convert MySQL data or static table data to csv, Excel,

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.