ksupport Posted December 28, 2007 Share Posted December 28, 2007 I got a challenge with my friend about uploading a file to a remote host behind proxies. He said, it is not possible at all in PHP. and he said, It can be done in Ruby. I know PHP only. I need to upload a Kfile.txt to a remote site.. ex, www.somexamplesite.com/upload.html upload.html has a form with action => upload.php file field name is "localfile" I got GET method idea., $fp = @fsockopen("tcp://".$host,$i,$errno,$errstr,10); if($fp) { @fputs($fp,"GET http://www.remotesite.tld/upload HTTP/1.1\r\nHost:www.domainhost.tld\r\n\r\n"); } I have no clue about post method with files. I am new to phpfreaks but not to php. I hope some php guru may know it. Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/ Share on other sites More sharing options...
GingerRobot Posted December 28, 2007 Share Posted December 28, 2007 It can, in theory, be done with cURL. In practice, you might run into issues. I can't remember the specifics, but people do have some problems with the file upload via cURL. If you google 'php cURL file upload' or whatever, you should find some examples and a better explanation of the problems you might have. Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/#findComment-424802 Share on other sites More sharing options...
Daniel0 Posted December 28, 2007 Share Posted December 28, 2007 Eh... FTP? SCP? Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/#findComment-424805 Share on other sites More sharing options...
ksupport Posted December 28, 2007 Author Share Posted December 28, 2007 its not FTP.. It is remote upload to a http page. Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/#findComment-424841 Share on other sites More sharing options...
ksupport Posted December 28, 2007 Author Share Posted December 28, 2007 googling about curl+file+upload... Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/#findComment-424843 Share on other sites More sharing options...
ksupport Posted December 28, 2007 Author Share Posted December 28, 2007 I think i got 50% success. a PHP Class uploads file with curl function help. will curl work behind proxies? Quote Link to comment https://forums.phpfreaks.com/topic/83492-challenge-with-my-friend-help-me/#findComment-424857 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.