Question image file from http server?

Rogueci5

Registered User.
Local time
Tomorrow, 02:19
Joined
Aug 2, 2010
Messages
41
Hi Guys :)
I know I must be missing something, and I have tried several different ways and viewed several vids, this should be REALLY simple but I can not find it :(

Access 2016 NOT signed in.

Ok I have a form running from a field in my tblToys that is named ToyPicture, data type set to short text and in the tbl I have used "C:\Local Publish\teddy\one.jpg" this works all fine and it should work on a local server, however when I use:

http://servername.com/resources/teddy/two.jpg it fails to load the image into the form.
I have used the Hyperlink data type and various others to test.
Should this work?

Cheers
Brett
 
This can not be done in Access?
Maybe. What follows is a declaration and function that will allow your to download the image. After the images is downloaded you could put the path in a textbox. That textbox being the control source for an image control.

Code:
Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
    (ByVal pCaller As Long, ByVal szURL As String, _
    ByVal szFileName As String, ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) As Long
Function DownloadURL(sSourceUrl As String, sLocalFile As String) As Boolean
    DownloadURL = (URLDownloadToFile(0&, sSourceUrl, sLocalFile, 0&, 0&) = 0)
End Function
 
Maybe. What follows is a declaration and function that will allow your to download the image. After the images is downloaded you could put the path in a textbox. That textbox being the control source for an image control.

Code:
Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
    (ByVal pCaller As Long, ByVal szURL As String, _
    ByVal szFileName As String, ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) As Long
Function DownloadURL(sSourceUrl As String, sLocalFile As String) As Boolean
    DownloadURL = (URLDownloadToFile(0&, sSourceUrl, sLocalFile, 0&, 0&) = 0)
End Function

Thanks mate I will give it a try on Monday and get back to you!
Cheers
 
Sneuberg sorry mate, I have not been able to look at this due to time, so I have gone with local drive storage.

Thanks so much, I will have a look at it in the future tho, it will not be a wasted message.

Cheers
 

Users who are viewing this thread

Back
Top Bottom