retinax
asked on
VB6 How to Upload Files thru HTTP
Hello,
This is in continuous from:
https://www.experts-exchange.com/questions/22729407/VB6-HowTo-POST-request-using-WinInit-APIs.html
Though that was asked by different developer.
I have similar situation but I am trying to upload images (jpg files), please tell me how to achieve that thru HTTP POST using WinINet.
Thanks a lot,
Zeeshan
This is in continuous from:
https://www.experts-exchange.com/questions/22729407/VB6-HowTo-POST-request-using-WinInit-APIs.html
Though that was asked by different developer.
I have similar situation but I am trying to upload images (jpg files), please tell me how to achieve that thru HTTP POST using WinINet.
Thanks a lot,
Zeeshan
Question, how are you receiving the files on the server?
ASKER
In PHP as:
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES ["file"][" tmp_name"] ,
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
?>
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, will try that out today and let you know...