Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem getting an Image from web and storing it in mysql

Status
Not open for further replies.

localhost

ISP
Apr 29, 2002
8
0
0
DE
hi, i would like to get an image from an web-url and store it into mysql-db.

inserting local images or images i upload to the server is no problem, but handling urls as images seems quite difficult..

now, for fopen() i need the filesize() of the image, but that command does not work on urls...

anyone got an idea how to solve this, perhaps even without writing an temporary image to disk? code snippets anyone?

thanks so far,

marcus --
^v^

127.0.0.1 - localhost
 
I'm not exactly sure how to go about doing this, but if you have access to phpBB, I know that it does the same thing you're talking about. You could download their program.. and search through and find the file(s) which are required and implement their code.

Although then you'd have to give credit where credit is due.


"Hey...Where are all the chicks?" -- unknown
 
Have a look at the CURL library, it handles URL's and may give you a clue. I also recal that you have to have a configuration operation switched on to allow url's in fopen(). You may have to go down to HTTP functions to see al the stream, or if you have windows the msxml component can open and read urld including images, if you need a code sample reply here
 
yes, please provide code sample. i can't find any information about grabbing an image from a website and writing it to mysql using php. then the hard part, reconstructing the page and outputting it with the image links now pointing to locally saved files?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top