Asheeown Posted January 30, 2007 Share Posted January 30, 2007 I have a search script and I want to incorporate having the option to download what the user has searched. Any ideas to kinda get me started, maybe a tutorial, much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/ Share on other sites More sharing options...
mkosmosports Posted January 30, 2007 Share Posted January 30, 2007 What do you mean "download what the user has searched"? Can you provide an example of this? Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173055 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 When the user searches he/her chooses a date and time to search between, it returns all the results in the database with those filters. I have the setup for the file I would like to download it to but I need an idea of how to redirect them so to speak Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173057 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 Can you re-explain that one more time? Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173060 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 Okay, User logs in, and goes to the log page. He or she defines a date with drop down menus to define what logs they want between one date and the next and it returns their results. That part is done, however I can't write temp result files for every time the search, so how can I incorporate a choice to download what they have just searched. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173064 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 Oh, you can fwrite it all into a temporary file, store it in a temporary directly, and give them a link dynamically to download that specific temporary file. Or save the search result's into a database, so you can replicate them later as needed. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173068 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 Well that is a good idea, just the database is very large and only getting bigger. So we need to keep queries down to a minimum. Would it be possible to have them click a link with the search filters in the URL and it open a new window and then it makes the temp file redirects to the file and then closes the pop up? Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173072 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 For open/close the window you can use javascript, but there has to be some form of action for that to happen.I am not 100% sure how your querie's, are saved. If they are saved through a get query, they can just bookmark the page.If you are wanting to allow them to generate a download temporarily, then delete it, You would have to somehow, unlink the file after they have downloaded it, by them giving some kind of signal, it was downloaded. Or you could email them the file.Create it, email it to them, and never save it anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173076 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 These files are way to large to email, deleting the temp files is no problem I have a cron job running to wipe the directory clean at 12 in the morning everyday Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173079 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 So, have you come to a solution to your problem. If so rephrase another question, so we can look into this more for you. I gave you the answers I could based on the understanding I gained of what you had originally said. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173081 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 Well the question was really how should I propose the download option? and really how should I go about creating a new file which the file name will already be provided Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173089 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 I still don't understand.They are running searches from a database?See generally to show a file, you just create the file, save it somewhere, present a download link. Optionally you can delete it later, or when they are done, if you can.[quote]Well the question was really how should I propose the download option? and really how should I go about creating a new file which the file name will already be provided[/quote]The download option, can only really be offered as a direct link. I guess you could start an auto-download when they do the search, but I really don'tt hink there is anything youc an do to start a download automatically, without them clicking on something, or something similarAs far as how to go about it, there is only 1 way. Create the file.you can create it, and save it, or create it, and maybe there is a way to offer it directly, but I think it has to be saved, before it can be offered for download. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173091 Share on other sites More sharing options...
boo_lolly Posted January 30, 2007 Share Posted January 30, 2007 i think what you may want to do is look into RSS feeds. converting the output of the search query into an XML format (temporarily) and then prompt the user to download the .html file. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173093 Share on other sites More sharing options...
boo_lolly Posted January 30, 2007 Share Posted January 30, 2007 try these links:http://www.feedforall.com/converting-rss-to-html.htmhttp://www.rssfeedconverter.com/http://www.wotzwot.com/rssxl.phphttp://www.uvm.edu/~ashawley/php/txt2rss.html Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173095 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 [quote]i think what you may want to do is look into RSS feeds. converting the output of the search query into an XML format (temporarily) and then prompt the user to download the file.[/quote]Actually that was a very good idea, and very valid point. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173096 Share on other sites More sharing options...
boo_lolly Posted January 30, 2007 Share Posted January 30, 2007 [quote author=businessman332211 link=topic=124760.msg517420#msg517420 date=1170190843][quote]i think what you may want to do is look into RSS feeds. converting the output of the search query into an XML format (temporarily) and then prompt the user to download the file.[/quote]Actually that was a very good idea, and very valid point.[/quote]thanks businessman ;D i try. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173099 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 Well what I mean is, I know how I will get them to the file but I can't create the file on the same page as the query. Although if I were to use a pop-up I could transfer the query filters and do it there, however when the file creation is done, and the redirect script goes to the file url, how would the pop up know to close Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173100 Share on other sites More sharing options...
boo_lolly Posted January 30, 2007 Share Posted January 30, 2007 well, what i mean is, on the results page for your queries, have a small link or logo that says something like 'Convert to RSS'. the idea is, when the user clicks it, it will run the function that will convert the outputted HTML results into an RSS format, store it temporarily, and then javascript to popup a small window prompting the user to press 'OK' to download the RSS feed. then boom! you're done. the page doesn't even have to reload. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173102 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 I'm not familiar with RSS at all Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173108 Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 Neither am I, I have been fighting with something with XMl for awhile.It can get tricky. Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173109 Share on other sites More sharing options...
Asheeown Posted January 30, 2007 Author Share Posted January 30, 2007 It needs to be a certain file format also .csv Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173112 Share on other sites More sharing options...
boo_lolly Posted January 30, 2007 Share Posted January 30, 2007 check out [url=http://us2.php.net/fgetcsv]fgetcsv()[/url]andhttp://area23.brightbyte.de/csv2wp.php Quote Link to comment https://forums.phpfreaks.com/topic/36385-downloader/#findComment-173114 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.