Execute PHP Upload From VB.NET

Hi,



I am wondering if anyone on the list has tried to use VB.NET to execute a=
PHP a script. I have made attempts of using the following code from the br=
owser like Firefox, which works, but when I try to use a VB.NET to execute =
the following script, I get the error every time at the else statement at i=
f(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) telling me =
that there is an error with the file even though I am only uploading a 2kb =
text file.



//Create a upload File

if ($directory =3D=3D'') {

echo "<p>Sorry, I don't understand which file you are uploading. Did you ch=
oose a file?</p>";

exit();

}

$filename=3D"C:/Inetpub/wwwroot/test";

if (file_exists($filename)) {

//Don't display anything

}

else {

echo "<p>Sorry, the specified patient directory does not exist.</p>";

}

$target =3D "test/" . basename( $_FILES['uploaded']['name']) ;

$ok=3D1;

//Here we check that $ok was not set to 0 by an error

if ($ok=3D=3D'0') {

echo "<p>Sorry your file was not uploaded.</p>";

}

//If everything is ok we try to upload it

else {

if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {

echo "<p>The file ". basename( $_FILES['uploaded']['name']). " has been upl=
oaded.</p>";

$file=3D $_FILES['uploaded']['name'];

list($name,$ext) =3D split('[/.]',$file);

echo "<p>Contour Name: " . $name . " </p><p>File Extension: " . $ext . ".</=
p>";

echo "<p>Thanks for using the system!</p>";

}

else {

echo "<p>Sorry, there was a problem uploading your file.</p>";

}

}



Could there be something I have missed in my PHP to allow a VB.NET code to =
interact with the above code?



Thanks to anyone who may help.



Alice

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei [at] indiana.edu

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ajwei [ Mo, 23 Juni 2008 20:13 ] [ ID #1957621 ]
PHP » gmane.comp.php.windows » Execute PHP Upload From VB.NET

Vorheriges Thema: PHP Mail 501 error
Nächstes Thema: MySQL on Windows