I have a PHP file hosted on my server which accepts parameter and uploads file a folder.
Here's the code :
==========================
<?php
$target_path = "/home/uploads/";
echo $_POST['username'] ."\n". $_POST['password'] ."\n";
$target_path = $target_path . basename( $_FILES['fileToUpload']['name']);
if(move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['fileToUpload']]['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
===========================
It works fine if post data from html file to this page and also uploads file.
now I want to do the same using vb.net (windows application).
I need sample code or demo application with one form which accepts username, password and file url from fileupload dialogue box and then on button click it should be posted to my server with parameters and file.
this page will return response which should be displayed on label.
I can provide you url of the page where is it hosted.
## Deliverables
I have a PHP file hosted on my server which accepts parameter and uploads file a folder.
Here's the code :
==========================
<?php
$target_path = "/home/uploads/";
echo $_POST['username'] ."\n". $_POST['password'] ."\n";
$target_path = $target_path . basename( $_FILES['fileToUpload']['name']);
if(move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['fileToUpload']]['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
===========================
It works fine if post data from html file to this page and also uploads file.
now I want to do the same using vb.net (windows application).
I need sample code or demo application with one form which accepts username, password and file url from fileupload dialogue box and then on button click it should be posted to my server with parameters and file.
this page will return response which should be displayed on label.
I can provide you url of the page where is it hosted.