envexlabs Posted December 18, 2008 Share Posted December 18, 2008 Hey, Is it possible to upload a file from one server to another via php that doesn't require ftp? Thanks, envex Quote Link to comment https://forums.phpfreaks.com/topic/137576-cross-domain-uploads/ Share on other sites More sharing options...
Maq Posted December 18, 2008 Share Posted December 18, 2008 Not sure... Did some research and found this piece of code from LinuxQuestions. $ch = curl_init("http://www.example.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/137576-cross-domain-uploads/#findComment-719077 Share on other sites More sharing options...
rhodesa Posted December 18, 2008 Share Posted December 18, 2008 http://us3.php.net/manual/en/function.curl-setopt.php Example #2 Quote Link to comment https://forums.phpfreaks.com/topic/137576-cross-domain-uploads/#findComment-719078 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.