Create File Download Snippets


07 March, 2011   

Shows how to create a simple file download by using PHP. The content could also be dynamically generated)

24 June, 2014   

For downloading very large files (10 meg or more), split the file into chunks when sending.

Usually when you try to download something from a web server you get a request asking whether you want to save the file or open it. To avoid that you can use the below code on your .htaccess file

13 November, 2014   

Here is a form that asks for Name and Email address. When the form is submitted the Email address is verified first. If you put in a Name and a correct Email address, an anchor element is displayed allowing the user to download the file, two cookies are created storing the Name and Email address. If the user goes BACK in the browser and tries...

Note that you must include the unit ExtActns in the uses clause.

08 February, 2017   

Code example to create a new file under linux

09 November, 2017   

Copies Source file to Dest file, preserving modification date. Required units: Classes, SysUtils.

23 January, 2012   

How to create a text file named newtest.txt . here shown an example ASP code

I had to scan a bunch of paper documents (one image per page), and upload them all to a web site that would accept only one PDF file containing the whole set.

11 February, 2013   

Quicktime still requires the double-object method to get it done across all browsers. Not super pretty, but it does get the job done.

01 June, 2013   

Example shows here how to Embed Code for Quicktime

16 April, 2011   

There are times when you need to split a large file into several smaller ones (for whatever the purpose is). The following two methods use Delphi TStream objects to break a file into several files with predefined size; and to merge those files back to the original.

10 August, 2011   

An easy way to send an HTML email with an attachment.

18 September, 2013   

PHP example for listing directory contents

22 March, 2015   

Program shows copying one text file from source location to any other location (destination), plus possibility of changing its name, and also shows many language features in exception handling. This program should be run from the command prompt

30 December, 2010   

Class to back up entire databases and email them out, or individual tables

11 June, 2012   

You may retrieve all needed file path data using PHP's built-in function pathinfo. You don't need to create your own functions or use regular expressions to get this info. It was already been created for this purpose.

09 February, 2011   

Class to back up entire databases and email them out, or individual tables.

13 April, 2011   

Reading a file to a string couldn't be easier than using the file_get_contents() function. Simple pass the name of the file (with path) and optional parameters

30 August, 2015   

Loads the contents of a dir an sorts them by the date of creation.