cannot open file error in loadfromfile
I am trying to open a file on a website via the url. At design
time, I can navigate to the website and select the file OK but I
need to extract the filename from a table and load it at
runtime.
The command I am using is
Using
ppItemPictureImage.Picture.LoadFromFile('http://xxx.xxx.xxx.xx/s
amspics/2542/254221 - idPic1.jpg') or if I actually type this
string into the load file dial I get '... Invalid filename' but
I can navigate through load dialogue I can load the image OK.
I have tried using double quotes in case it doesn't like the
spaces in the filename.
Any ideas anyone?
time, I can navigate to the website and select the file OK but I
need to extract the filename from a table and load it at
runtime.
The command I am using is
Using
ppItemPictureImage.Picture.LoadFromFile('http://xxx.xxx.xxx.xx/s
amspics/2542/254221 - idPic1.jpg') or if I actually type this
string into the load file dial I get '... Invalid filename' but
I can navigate through load dialogue I can load the image OK.
I have tried using double quotes in case it doesn't like the
spaces in the filename.
Any ideas anyone?
This discussion has been closed.
Comments
The TppImage.Picture property is a reference to the TPicture object. If
you take a look at the Delphi help on the TPicture.LoadFromFile topic it
states the following.... "Use LoadFromFile to read a picture from disk." I
do not believe you can use this method to load a file directly from the
Internet. You will probably need to get this file on your hard drive first
before calling LoadFromFile.
To get this file on disk, you might research the Indy Http client. I
believe it has the capability of streaming a file from an internet resource.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com