Php file just download






















How satisfied are you with this reply? Thanks for your feedback, it helps us improve the site. In reply to A. User's post on September 2, A subscription to make the most of your time. Sign Up. Yes, I'm sure. You previously marked this answer as accepted. Are you sure you want to unaccept it? DigitalOcean home. Community Control Panel. Hacktoberfest Contribute to Open Source.

Posted July 18, I set cgi. Add a comment. Subscribe Subscribed. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 8 months ago. Active 6 months ago.

Viewed 4k times. Improve this question. Try removing the headers and see if you get an error — gosukiwi. Add a comment. Active Oldest Votes. However, zip and exe files are downloaded automatically to the hard drive by default. You can force images or other kind of files to download directly to the user's hard drive using the PHP readfile function.

Here we're going to create a simple image gallery that allows users to download the image files from the browser with a single mouse click. If you see the above example code carefully, you'll find the download link pints to a "download. Also, we've used PHP urlencode function to encode the image file names so that it can be safely passed as URL parameter, because file names may contain URL unsafe characters.



0コメント

  • 1000 / 1000