Execute PHP Upload From VB.NET

Execute PHP Upload From VB.NET

am 23.06.2008 20:13:34 von ajwei

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 =='') {

echo "

Sorry, I don't understand which file you are uploading. Did you ch=
oose a file?

";

exit();

}

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

if (file_exists($filename)) {

//Don't display anything

}

else {

echo "

Sorry, the specified patient directory does not exist.

";

}

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

$ok=3D1;

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

if ($ok=='0') {

echo "

Sorry your file was not uploaded.

";

}

//If everything is ok we try to upload it

else {

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

echo "

The file ". basename( $_FILES['uploaded']['name']). " has been upl=
oaded.

";

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

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

echo "

Contour Name: " . $name . "

File Extension: " . $ext . ". p>";

echo "

Thanks for using the system!

";

}

else {

echo "

Sorry, there was a problem uploading your file.

";

}

}



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=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php