Servlet code to download text file from website – Java

Here’s a servlet code example to download a text file from a website. For example Let’s say a text file named “testing.txt” , and you want to let user download it with a URL , for example “http://localhost:8080/servlet/DownloadDemo” . 1. Create a text file named “testing.txt” , put it into the project root folder. \–servlet …

Read more

PhP file display as downloading instead of interpreted by Apache

Problem While accessing the PHP file, it display as “application/x-httpd-php” downloading instead of interpreted properly by Apache. See figure below : Solution The PHP downloading issue is caused by the Apache didn’t load the PHP module properly. 1. Find and edit Apache configuration file, which should be able to find at $APACHE_PATH/conf/httpd.conf. 2. Make sure …

Read more