Emadkhan Posted September 20, 2014 Share Posted September 20, 2014 I have a Joomla website having one folder for audio files in it and their links are saved in database.Now I want to show two calendars to the user at front end, so that they can choose that from when to from he want to download the audio files?for e.g he can select june-2-2014 in one calendar and august-2-2014 in second calendar, now on clicking download button the files residing between the two specific dates must get archived into one zip file and then start downloading... i have a reference link for creating a zip and downloading the zip :http://coursesweb.net/php-mysql/create-zip-file-archive-php_cs now i am stuck that how to get the selection of user from calendar , save it into the array , and from the array get the files from the folder matching the array indexes and then zip , download them. please tell me how to achieve this task ? Quote Link to comment https://forums.phpfreaks.com/topic/291186-how-to-download-audio-files-from-direcotry-according-to-the-ids-from-database-in-php/ Share on other sites More sharing options...
NotionCommotion Posted September 20, 2014 Share Posted September 20, 2014 now i am stuck that how to get the selection of user from calendar , save it into the array , and from the array get the files from the folder matching the array indexes and then zip , download them. Thats all your stuck on? Start with a calender. Keep it client side with JS (jQueryUI has one). Now you have two dates in your form. One option is to submit your form using Ajax. Server then gets the two dates, validates them, and performs a query between those two dates. The server then creates the zip file, and stores it in a tmp directory with a random name, and returns the name of the file to the client. The client then redirects to that file. Consider a cron job to keep your temp folder from filling up. Alternately, you could traditionally submit your form, and then stream back the file, but it will take more resources. I am sure there are other ways to skin this cat. Quote Link to comment https://forums.phpfreaks.com/topic/291186-how-to-download-audio-files-from-direcotry-according-to-the-ids-from-database-in-php/#findComment-1491672 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.