Azu Posted February 2, 2007 Share Posted February 2, 2007 How do I use PHP to echo a specific URL so that the user can download the url directly instead of PHP having to download it first? Or is it a different command not echo that I must use? Please help Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/ Share on other sites More sharing options...
Cep Posted February 2, 2007 Share Posted February 2, 2007 echo or print just outputs a string on the users screen (it has other uses too) but what you said doesn't make any sense at all. Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175327 Share on other sites More sharing options...
Azu Posted February 2, 2007 Author Share Posted February 2, 2007 How do I just tell the client to use a URL so that the client downloads it instead of having the PHP script download it and then upload all it's contents which takes longer? Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175335 Share on other sites More sharing options...
obsidian Posted February 2, 2007 Share Posted February 2, 2007 How do I just tell the client to use a URL so that the client downloads it instead of having the PHP script download it and then upload all it's contents which takes longer? I'm still not sure I fully understand. Are you looking to have a direct download of a file rather than the browser displaying it? If so, you can change the header information of the file. Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175338 Share on other sites More sharing options...
Azu Posted February 3, 2007 Author Share Posted February 3, 2007 I'm looking for the client-side version of include if that makes any sense Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175869 Share on other sites More sharing options...
corbin Posted February 3, 2007 Share Posted February 3, 2007 Basically you want to send the headers to the client that says "Hey this is a file to download" (tell me if you can't find the correct headers, and I'll try to find them)... Then you can use readfile() or include to send the file contents to the browser. I think this is what you're trying to do anyways... Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175906 Share on other sites More sharing options...
hitman6003 Posted February 3, 2007 Share Posted February 3, 2007 Just do a header to redirect the user to the download.... header("Location: http://www.someothersite.com/filetodownload.txt"); The user will download the file and your server won't have to do anything. Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175925 Share on other sites More sharing options...
Azu Posted February 3, 2007 Author Share Posted February 3, 2007 Omg I had totally forgot about that function lol! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/36758-solved-echo/#findComment-175954 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.