Sign in to follow this  
Followers 0

upload with http php

2 posts in this topic

#1 ·  Posted (edited)

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", "", False)
            $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/2009042316 Firefox/3.0.10 (.NET CLR 4.0.20506)")
            $oHTTP.SetRequestHeader("Referrer", "")
            $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
            $oReceived = $oHTTP.ResponseText
            $buffer = ""
Edited by legend

Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

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.

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  
Followers 0