Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Website Uploading

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Website Uploading

Postby Kenneth » Mon Apr 07, 2003 7:07 pm

Hi:

I am wondering, does anyone know how to upload files from a website to another? For example, on phpBB, you can upload an avatar image from another site by simply entering a URL with an image like: http://www.somesite.com/someimage.jpg . I'm wondering, in PHP form, does anyone know how to do that using fopen(), and copy()? Could someone please show me an example using PHP? Thanks a lot!!
Kenneth
New php-forum User
New php-forum User
 
Posts: 40
Joined: Fri Aug 09, 2002 11:53 am
Location: Rochester, NY

fopen and fread

Postby andrewdavey » Wed Apr 09, 2003 2:39 am

Hi,

You can probably fopen the url to the image file and use fread to get the entire file stored in a variable. Then fopen a new file on your server and fwrite the variable to that file. :D Phew! That should do it!
andrewdavey
New php-forum User
New php-forum User
 
Posts: 16
Joined: Wed Feb 12, 2003 5:27 am
Location: Cornwall, England


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron