TheUnknownCylon Posted March 17, 2008 Share Posted March 17, 2008 Hi all, I've been working on a script what should do something like this. I upload a file through a simple form. PHP Get's this file and storest it into a $_FILE['x']['tmp_name']. The PHP calls another website with fopen() to get the source of the requested page. With that pagerequest PHP also sends the file. User uploads file -> File in my PHP File -> Call to another site with FILE. How can I do this? Here is the basic code.: $data = http_build_query( array( 'MAX_FILE_SIZE' => '1548576', 'aff' => '', 'type' => 'blank', 'where' => 'iframe', 'fileupload' => $_FILES['fileupload']['tmp_name'], 'submit' => $_POST['submit'] ) ); $params = array('http' => array( 'header' => 'Content-Type: multipart/form-data', 'method' => 'POST', 'content' => $data )); $context = stream_context_create($params); $fp = @fopen('test.php', 'rb', false, $context); $response = @stream_get_contents($fp); fclose($fp); When I run this code the last page does not recognize the attached file. My first thought is that the file not should be included in the params list. But then I don't know how to it correct. Searching the web didn't help me out of this. Hope you can help me! Link to comment https://forums.phpfreaks.com/topic/96569-upload-file-with-post-mehtod-form/ Share on other sites More sharing options...
TheUnknownCylon Posted March 19, 2008 Author Share Posted March 19, 2008 Bump. Only 15 views and already int he 5th page of topics... Link to comment https://forums.phpfreaks.com/topic/96569-upload-file-with-post-mehtod-form/#findComment-495767 Share on other sites More sharing options...
TheUnknownCylon Posted March 21, 2008 Author Share Posted March 21, 2008 ¿Hello? Link to comment https://forums.phpfreaks.com/topic/96569-upload-file-with-post-mehtod-form/#findComment-497340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.