Gruzin Posted September 11, 2006 Share Posted September 11, 2006 hi guys, hope you are doing well!I need your help with a php download script (I've googled it, but...), so I don't know from where to start. can u please give me a good tutorial or some reference to read? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/ Share on other sites More sharing options...
corbin Posted September 11, 2006 Share Posted September 11, 2006 So ummm what exactly do you mean? Like a dynamic script that will hide a file's true location, or simply force a user to download something? Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90046 Share on other sites More sharing options...
Gruzin Posted September 11, 2006 Author Share Posted September 11, 2006 well actually, I want the script to download something when page loads, any ideas how can I start writing that? Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90048 Share on other sites More sharing options...
corbin Posted September 11, 2006 Share Posted September 11, 2006 Forgot exactly how to do it... It involves headers... Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90057 Share on other sites More sharing options...
Gruzin Posted September 11, 2006 Author Share Posted September 11, 2006 I am trying to use google but it displays the results where I can DOWNLOAD other things :) Can't find php DOWNLOAD tutorial... Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90059 Share on other sites More sharing options...
corbin Posted September 11, 2006 Share Posted September 11, 2006 Hmm just found http://www.phpfreaks.com/forums/index.php/topic,95433.0.html bout to read thru it now... Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90062 Share on other sites More sharing options...
Gruzin Posted September 11, 2006 Author Share Posted September 11, 2006 ok, thank u very much corbin, I'll try that. I've also found something on php.net :) Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90064 Share on other sites More sharing options...
yong Posted September 12, 2006 Share Posted September 12, 2006 Gruzin ,can you write the url about what do you found.. Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90168 Share on other sites More sharing options...
Gruzin Posted September 12, 2006 Author Share Posted September 12, 2006 I've found not much info :(Here is the URL [url=http://ge.php.net/header]http://ge.php.net/header[/url] Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90263 Share on other sites More sharing options...
Jenk Posted September 12, 2006 Share Posted September 12, 2006 [code]<?phpheader('Content-disposition: attachment');readfile('/path/to/file.txt');?>[/code][/code] Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90265 Share on other sites More sharing options...
Gruzin Posted September 12, 2006 Author Share Posted September 12, 2006 [quote author=Jenk link=topic=107696.msg432573#msg432573 date=1158050314][code]<?phpheader('Content-disposition: attachment');readfile('/path/to/file.txt');?>[/code][/code][/quote]I need something like this: when user clicks on a link, I want to download the file without promting the user. The example above asks user download or not the file... Thanks anyway. Still I have no idea how to do that, any suggestions will be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90269 Share on other sites More sharing options...
Jenk Posted September 12, 2006 Share Posted September 12, 2006 In a word - no. You cannot do that.Just think of the security implications if web-devs could force the user to download whatever they want.. Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90272 Share on other sites More sharing options...
Gruzin Posted September 12, 2006 Author Share Posted September 12, 2006 ok, can I display the Alert in html code and not the browser Alert window? like when it asks save, open or cancel download? Thanks for your answers Link to comment https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90273 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.