Jump to content

Recommended Posts

Posted (edited)

hey all

how i could make my website to be able to download from it files that are different or not common like .txt

via web browsing

i get the file worng just 1.6k

i open it with notepad and saw same information of the http connection

thx in advanced

edit

moder pls move to Server - Side Help (IIS, Apache, etc.) sub-fourm

thx

Edited by aviv00
  • 1 month later...

Posted

once your file is uploaded to the server you can set header like...

header("Content-type: application/force-download");

header("Content-Transfer-Encoding: Binary");

header("Content-length: ".filesize($file));

here $file is full path with file name.

thanx,

ravs

Posted

I would suggest using the correct MIME Type instead of application/force-download. Different browsers may choose to interpret this differently.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...