How do I force a download?

Answer Posted / guest

When someone downloads a document, the server tells the
browser what type of file it is. The browser then picks the
appropriate helper application, or displays it himself. If
the server doesn't know the file type, it tells the browser
that the file is "text/plain", or just plain text. You will
have to ask your server admin to configure this particular
file with the MIME type you want.

"Forcing" a download is not what you are supposed to do.
After all, what is more convenient than having the proper
application started when I download a particular file?
Browsing through a download directory can be quite a pain.
And most browsers allow the user to download to disk if they
want to.

If the file must be saved to disk, as there is absolutely NO
other way to handle it, the MIME type should be
"application/octet-stream".

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is html applet?

464


Explain something about the new element?

479


Explain formtarget attribute of html5?

486


How can I have two sets of links with different colors?

454


How do I close a browser window with html code?

534






How to you set the background image of the page using HTML?

445


How we can draw rectangle using svg in html5?

471


What is the hierarchy that is being followed when it comes to style sheets?

600


What are the body tag attributes?

490


What is button tag?

472


What is innerhtml?

471


What is h in html?

436


Is syntax a repetition?

503


Is there advantages of collapsing white spaces in html?

457


What are the attributes that make up a dhtml?

546