Jump to content
Sign in to follow this  
legend

upload with http php

Recommended Posts

legend

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

Share this post


Link to post
Share on other sites
FireFox

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  

×