PDA

View Full Version : AJAX Downloads page, please help



Horacio
05-08-2010, 02:28 PM
Hi everyone,
I have a downloads page displaying the content of a directory (sub-folders and files) in an HTML table.
Ckicking a sud-directory reloads all the page with the new directory.
Clicking a file send it to a php paee for download.
I choose to use Ajax to reload only the changing part in a div. This works fine when navigating in the folders, but the download part dosn't work.
I have created two arrays for the hole download directory (one for the folders and one for the files). The table is created within a foreach loop.
The original link for a file is:
[CODE]
echo '
<a href="'.$down.$file_name .'&path='.$file_path.'/">'.$file_name.'</a></td>';
[CODE]
with [ICODE] $down='mydownlod.php?file=';[ICODE]
Any idea on how to have this to work with Ajax?
Thanks.