How do upload a file to a MS Windows IIS web server?

Web1.PostFile DOES NOT WORK, with or without the 'set Web1 request headers to'

In my app I get back, after several seconds, 'INTERNAL SERVER ERROR...500'

So Windows does not like what MIT APP INVENTOR is trying to send it.

Is it even possible? Or am I wasting my time?

What about using a form with a html image picker input in it?

And just give web1 the flick as far as trying to upload files goes?

Please explain more in detail what you are trying to do. Is there a server running on your Windows pc? Why do you think, these headers are necessary? Is there any API documentation?

Taifun

Select an image file with the file picker and upload it to my windows IIS web server.

This method works with a Linux apache web server:

<?php

// Simple PHP script to save image file.


$imgDir = "images/";


$fileName = $_REQUEST['fname'];


$data = file_get_contents('php://input');


$store = file_put_contents($imgDir.$fileName, $data);


if  ($store !== false ) {

echo "File $fileName saved to server, $store bytes\n";

} else {

echo "File $fileName not saved\n";

}

?>

But it does not work with a windows IIS web server.
This is my PHP code but it never gets executed as the PostFile request from my MIT App Inventor App never reaches my web page.
Instead I get the 500 error in my app.

	// File upload?
	else if (!empty($_POST))
	{
		$strMemberID = "";
		
		if (IsLogoImageUpload($strMemberID))
		{
			if (strlen($strMemberID) > 0)
			{
				$strProfileFilename = DoGetProfileImageFilename($strMemberID);
				$results = DoUpdateQuery1($g_dbFindATradie, "members", "profile_filename", $strProfileFilename);
				if ($results)
				{
					$data = file_get_contents('php://input');
					$nBytes = file_put_contents($strProfileFilename, $data);
					
					if ($nBytes > 0)
						echo "OK";
					else
						echo "File '" . $strProfileFilename . "' could not be saved!";
				}
				else
				{
					echo "Could not update 'profile_filename' column for member '" . $strMemberID . "'!";
				}
			}
			else
			{
				echo "PROFILE image file name member ID is blank!";
			}		
		}
		else
		{
			//print_r($_POST);
		}
	}