Buchead Posted November 3, 2011 Share Posted November 3, 2011 Apologies if this is in the wrong thread but no sure where it should have gone (if anyone can tell me I'd appreciate it). Anyway, I'm having a problem with HTTP POST. In the header no file is being specified, only the root file system. All the other times I have used this a file is specified so how can I detect the data transfer and handle the data? The header: POST / HTTP/1.0. .Accept: */*..Accept-Language: en-us..Content-Type: application/x-www-form-urlencoded..Host: thesite.co.uk Content-Length: 135 Pragma: no-cache username=user&password=password It's coming through port 21 on the server. Someone suggested putting some form of listening app on the port but then they countered it saying this would prevent any files being ftp'd to the server. Any assistance would be greatly appreciated! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/ Share on other sites More sharing options...
trq Posted November 3, 2011 Share Posted November 3, 2011 What exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284567 Share on other sites More sharing options...
Buchead Posted November 3, 2011 Author Share Posted November 3, 2011 Sorry, should have said. A 3rd party app is sending data to our server to update a web shop. After the username and password would be all the product information in csv format. I need to grab this data and then process it. What I'm struggling to do is grab the data. If they pointed it at a file on our server I could process it just like a form. Whether this is the right procedure I don't know, however it's how I've used HTTP POST in the past. As this data is being pointed at any file I can't see how to grab it. Hopefully this makes a little more sense now! Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284575 Share on other sites More sharing options...
trq Posted November 3, 2011 Share Posted November 3, 2011 You will indeed need to setup a server to listen on port 21. You could easily use Apache for this. Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284582 Share on other sites More sharing options...
Buchead Posted November 3, 2011 Author Share Posted November 3, 2011 Excellent, thanks for that. But would it prevent ftp'ing of files? We don't actually have control over apache on the server so is it easy to do? Sorry for all the questions but never encountered this before. Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284587 Share on other sites More sharing options...
trq Posted November 3, 2011 Share Posted November 3, 2011 If you already have an FTP server running on port 21 yes it will prevent uploading of files via FTP. IS there particular reason your receiving the data on port 21? And no, if you don't have control over Apache you will not be able to configure it to listen to an uncommon port. Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284596 Share on other sites More sharing options...
Buchead Posted November 3, 2011 Author Share Posted November 3, 2011 The 3rd party app uses port 21 and nowhere can it be configured to use another port. Many thanks for your advice, it's been extremely useful. Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284619 Share on other sites More sharing options...
Adam Posted November 4, 2011 Share Posted November 4, 2011 I would question why the developers of the third-party app chose to send requests through port 21 when 80 is the default for HTTP..? Have you asked them if it's configurable at their end? Quote Link to comment https://forums.phpfreaks.com/topic/250359-http-post-question/#findComment-1284851 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.