I'm wanting to create a website that allows an user to put a link in a field and once the user submits the form, the "image" link added to the field will be remote uploaded to my server (to the 开发者_JAVA百科path I specified in my server).
A friend of mine did this once, and he told me that he used the file_get_contents() function to get this working, but I cannot figure out how I'd do it.
Any help would be appreciated.
Thanks.
file_get_contents() will read file contents into a variable.
if you need to copy file to your server, use copy()
instead.
copy($_POST['link'],basename($_POST['link']));
精彩评论