Jump to content

upload with http php


Recommended Posts

Hi. I got this little script, where I want to upload some text, or eventually a file. (I don't want to use a winhttp udf) so this little script works, the 

problem is, that I don't know how to make a php script that can receive the file, and upload it to a folder, someone whos skilled in php, can maybe help me out :)?

My autoit script:

$data = "this is some text that should be sent to the server, or could be a file maybe"
            $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
            $oHTTP.Open("POST", "http://www.mysite.net/upload.php", False)
            $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 4.0.20506)")
            $oHTTP.SetRequestHeader("Referrer", "http://www.yahoo.com")
            $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
            $oHTTP.Send($data)
            $oReceived = $oHTTP.ResponseText
            $buffer = ""
Edited by legend
Link to comment
Share on other sites

Hi,
You are on an autoit forum, and you know that. So why would we be able to help you?

Moreover there are a lot of php upload examples if you make some googling.
 

http://lmgtfy.com/?q=PHP+upload+script

Edit: Your POST data is malformated, you have to do something like data=mydata.

Edit2: If it's a file then you need other header params...

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...