harismahesh Posted September 10, 2012 Share Posted September 10, 2012 I know the basic functionality of PHP file upload and download. I need some idea about how to upload files to a specific date and download when that date is selected. I need to upload daily reports to server. When user wants to see the report, he needs to select the date. So the reports uploaded that date will be listed and user can download the report. Can anyone help me how to do that using php ? Quote Link to comment https://forums.phpfreaks.com/topic/268209-how-to-download-files-when-date-is-given/ Share on other sites More sharing options...
kicken Posted September 10, 2012 Share Posted September 10, 2012 When you upload the files you would save a record in your database indicating the filename and the associated date (either user entered or automatic). Then to list them just run a query against the table for any files in a given date range and generate your list with a link to the file. The steps would look something like if (/* User is uploading */){ //Save the file somewhere to disk //Store location saved and date to database } else if (/* User is searching */){ //Query database for files where date = $userEnteredDate (or date between $userDate1 and $userDate2 for a range) while (/* we have results from above query */){ //Output a link to the file using the stored path } } Write some code and try to implement the steps. If you get stuck somewhere post the code and what you're stuck on. Quote Link to comment https://forums.phpfreaks.com/topic/268209-how-to-download-files-when-date-is-given/#findComment-1376652 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.