View Full Version : Url link question????

06-23-2006, 06:46 AM
Hi, I have a script that generates and sends an email to a user. In this email, I want a generated link for the user to be able to click on and download a file. Here is my problem, my server doesn't allow files over 2MB to be hosted so the files are actually stored on a diferent server on the internet which is a "file hosting server" only, but the email php script is on my server. Here is what I mean:
Example 1: www.mysite.com
Example 2: www.hosted_file_site.com/filename.zip

So what I need is some code that I can add to my email script that will generate the download link while protecting the file's actual location and it's host location. Since I am very, very new at php could you please show me some code to do this with, please?


06-23-2006, 07:49 AM
Hrmmm, tricky. You would have to use http://uk2.php.net/manual/en/function.readfile.php but, I don't think readfile allows cross server. You'd have to share databases between the 2 servers and use readfile on the file hosting one.

In summary, not very easy and requires thought.


06-23-2006, 10:18 AM
Its not working. Please I need help?

06-23-2006, 02:25 PM
The problem here is that in order to download a file the user would have to go to the file itself, no matter where it is hosted. I don't know if you will be able to completley hide this link, but there may be some ways to mask it. For example, try having the link in the email to your site, and then add a redirect over to the files site. This isnt that good of a solution though because it would be in the address bar of the browser... maybe use javascript to pop up a new window without the adress bar. Again only a half hjearted answer, but to completley hide it would require some complex coding.