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. Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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... Quote Link to comment 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... Quote Link to comment 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... Quote Link to comment 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 :) Quote Link to comment 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.. Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment 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. Quote Link to comment 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.. Quote Link to comment 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 Quote Link to comment 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.