In PHP, I need to make a POST request, but one of the variables must be a text file. How do I do it? -


What do I have to do here in my PHP script, I need to make a post request, but an argument to the data The text file should be sent as txt I have already written a small script that will send the argument by sending a POST request. The server expects an argument that has an array with two elements, arg0 and arg1. Arg0 is a regular string, but arg1 should be a text file. The content of this file has been serialized in a variable. I could save the content of this variable in a local text file, but how do I load this file as an array of arg1 items?

Any help would be appreciated.

If you are using HttpRequest (PHP 5.3) then there is a method called addPostFile which you use You can see the document here:


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -