Jump to content
Sign in to follow this  

not send image (UDF _WinHttpSimpleFormFill)

Recommended Posts


server php source....is

save to upload.php


<title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">
<input name="upfile" type="file"><br>
<input type="submit" name="submit" value="Upload">

if (isset($_POST['submit']) && !empty($_FILES["upfile"]) && move_uploaded_file($_FILES['upfile']['tmp_name'], "up/".basename($_FILES['upfile']['name']))) {
   echo "move ok "."up/".basename($_FILES['upfile']['name']);
} else {
  echo "not move ".$_FILES['upfile']['error']." ->".$_FILES['upfile']['tmp_name']." ->".$_FILES['upfile']['type'];


upload.au3 source.....

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "WinHttp.au3"
Global Const $Adresas = "test_website.com"
$subdomain = "/upload.php"
$file = @scriptdir & "tttt.txt"
Global $test = _WinHttpCreateUrl($Adresas)
Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1")
Global $hConnect = _WinHttpConnect($hOpen, $Adresas)
$Token = _WinHttpSimpleRequest($hConnect, "POST")

Global $sHTM = _WinHttpSimpleFormFill($hConnect, $subdomain, "index:0", "name:upfile", $file ,"X-Atlassian-Token: nocheck")


ConsoleWrite($sHTM )

it's tttt.txt is upload......Successfully uploaded.


$file = @scriptdir & "tttt.jpg"


$file = @scriptdir & "tttt.zip"


don't upload.......  

echo $_FILES['upfile']['error'] ==> value is 3...




how to can image or zip file upload????

Edited by davidkim

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

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