Changed
downloader to support custom file names (#2 from your list).
Sample call (browser will try to save with file name specified by
fc parameter):
download.php?
f=phptutorial.zip&
fc=php123tutorial.zip
But if you want to use script like this: download.php?
f=12345
and you want this to send phptutorial.zip from your server, then download.php needs to be modified to match your needs. Custom database connection/filename retrieval code needs to be placed before the
// Check if the file exists line. So it would look somewhat similar to (just example):
// connect to database and get real file name by provided id
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or die("Could not connect to database");
mysql_select_db(MYSQL_DB_NAME, $link) or die("Could not select database");
$result = mysql_query("select RealFileName from FilesTable where FilesTable.Id = " . mysql_escape_string($fname));
$res = mysql_fetch_row($result);
$fname = $res[0]; // this is the file script will send to the browser instead of 12345 code
mysql_free_result($result);
mysql_close($link);
// Check if the file exists
Option #1 from your list is not supported yet. I'll post update here when this feature added (this should trigger automatic email to you).