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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:24:57+00:00 2026-06-15T14:24:57+00:00

On my web server, I have a bat (harmless) file. And I have code,

  • 0

On my web server, I have a bat (harmless) file.

And I have code,

<a href="test.bat" title="Bat">Test Bat File</a>

But when the user clicks, it shows the code instead of downloading the file.
You have to right click “save as..” to download the bat file.

Is there way that when a user clicks, it downloads (not having to right click save as)?
Maybe a pop up window that asks user if he/she wants to download the file or not?

  • 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-15T14:24:58+00:00Added an answer on June 15, 2026 at 2:24 pm

    you could write a php file, which adds a content-disposition header, sets the mime type to something binary and echo the files content.

    Example:

    file.php

    $batchfile = file_get_contents('batchlocation');
    $size = strlen($batchfile);
    header('Content-Disposition: attachment; filename="downloaded.bat"');
    header('Content-Type: BAT MIME TYPE or something like application/octet-stream');
    header('Content-Lenght: '.$size);
    echo $batchfile;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application and web-server working together. Now I want user log
In an handler of Tornado web server I have this code: class NetworkSensorsHandler(BaseHandler): #
On my web server I have a video file named 03.mp4 . I have
for a C++ Web-Server I have to generate session id's. I thought of using
I've set up Nginx as my main web server and have two Mochiweb based
I have a web server which I do not know what the time zone
I have a web server located in Switzerland and it is intended to serve
I have enabled the Web Server on my Mac OS X (10.5.6) by going
I have a web server which is protected behind http-basic-auth. I've read through the
I currently have a single web server hosting multiple WordPress sites which use W3TC.

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.