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 7771885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:45:27+00:00 2026-06-01T16:45:27+00:00

I want to force the browser to download all files linked inside a RSS-Feed,

  • 0

I want to force the browser to download all files linked inside a RSS-Feed, that is created by a php-script.

Therefore I need to change the HTTP-headers of these files and set

header("Content-Disposition: attachment; filename=$file");

(and maybe also some other changes).

At the moment I try to do this using a download script, that sets these parameters.

However, the disadvantage of this method is, that I have to link to “download.php” instead of “target.file”, which is somehow misleading for the user. Besides, I have to reveal the internal file path to the user or use quite a lot of GET-variables instead.

It would be much better if it was possible to change the HTTP-headers inside the script that generates the RSS-Feed. Is there a way to achieve this?

  • 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-01T16:45:29+00:00Added an answer on June 1, 2026 at 4:45 pm

    You can’t change the headers from inside the RSS feed. You could, however, hide the download.php part with some rewrite magic:

    RewriteEngine on
    RewriteRule ^download/.*$ /download.php?file=$1 [L]
    

    This would cause any URL starting with /download/ to be run through your download script:

    • /img/foo.jpg – normal file
    • /download/img/foo.jpg – force a download

    You could do a similar thing without the PHP too:

    RewriteEngine on
    RewriteRule ^download/.*$ /$1 [L]
    
    <Location /download>
        Header add Content-Disposition "attachment"
    </Location>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to force the browser to download a pdf file. I am using
I guess I want to ultimately build out a script that will force the
I am currently working on a PHP script that allows you to download media
I want to force a PDF to download, rather than load in-browser. I'm using
I want to force user to download images. Not open in browser. It is
I want to force the download of an image. I have found this code:
I want to use autocomplete (jquery or .net) with force a choice so that
I am trying to use http://code.google.com/p/amazon-s3-php-class/ to force-dowload files from AWS S3. I have
I have an application in which I want to force an image to download,
Web applications that want to force a resource to be downloaded rather than directly

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.