Looktrne Posted September 21, 2008 Share Posted September 21, 2008 I have a directory of photos that I uploaded I want to email someone a link that will automatically download the photos for example http://mysite.com/photos/ say there is 20 photos in this folder is there a way to make all the contents of this folder download to the broswer? not sure if php or html would be used for this... any advise? I want this to work without compressing the photos into one file. thanks for any help Paul Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/ Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 force download you want mate...... http://www.phpfreaks.com/forums/index.php/topic,95433.0.html Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/#findComment-646815 Share on other sites More sharing options...
Looktrne Posted September 21, 2008 Author Share Posted September 21, 2008 I looked at this ... it seems to force an individual file how can I use this to force the download of all files within the directory? Paul Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/#findComment-646828 Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 see the truth is each file needs to come down in one, The only way is to zip the files, then let user download them via a zipped folder............. SAYING THAT.... i dont no if it possable to force all files down with a while loop..............with the linked code i provded.... Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/#findComment-646832 Share on other sites More sharing options...
chronister Posted September 21, 2008 Share Posted September 21, 2008 redarrow is right, you cannot download an entire directory. You will either need to zip them on the fly and force the download, or loop through and force the downloads individually. There is no way to download 20 files as 1 single download... at least not to my knowledge. It just don't make sense with the way files are handled on the web. Take FTP for instance. You can select 100 files to download, but they don't come all in 1 stream. The ftp client builds a queue of all the files and then downloads them individually 1 stream at a time. Me personally, if I hit a page that popped up 20+ save dialogs because a force download script was looped, I would be pissed and would probably cancel them and not go back again. I suggest zipping them on the fly and force the 1 zip file to download. Nate Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/#findComment-646897 Share on other sites More sharing options...
Looktrne Posted September 21, 2008 Author Share Posted September 21, 2008 thanks for the help Link to comment https://forums.phpfreaks.com/topic/125143-solved-need-to-make-directory-downloadable/#findComment-646983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.