I have several images in /public_html/images/ restricted using .htaccess Meanwhile I created a php file that gets an image.
Example before using POST to change specific ID
<?php>
$file = '/home/user/public_html/foodimage/ID-856-front.jpg';
header('Content-Type: image/jpeg');
print $file;
?>
How can I create my Webrequest to pull the image requested from this php file.
Dim request As System.Net.WebRequest = System.Net.WebRequest.Create(url)
request.Proxy = Nothing
request.Method = "POST"
Dim postData = postvalues
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim response As WebResponse = request.GetResponse()
dataStream = response.GetResponseStream()
Dim x As New BitmapImage
x.StreamSource() = dataStream
dataStream.Close()
response.Close()
Return (x)
Please Help. I able to pull off json arrays and strings in a similar function but I can't seem to retrieve images.