Jump to content

Archived

This topic is now archived and is closed to further replies.

Deserteye

file upload

Recommended Posts

File uploads require POST method to be used and links use GET.  It cannot be done unless I'm misunderstanding what you're asking.

Dest

Share this post


Link to post
Share on other sites
[quote author=Destruction link=topic=113159.msg459697#msg459697 date=1162158988]
File uploads require POST method to be used and links use GET.  It cannot be done unless I'm misunderstanding what you're asking.

Dest
[/quote]
you know how you can type in a link to an image on photobucket or imageshack and it will upload it to your gallery.. how would I do that?

Share this post


Link to post
Share on other sites
Okay so what you actually mean is to download an image to your server from another site?  Often called transloading (site->site).  You may want to look at the File Handling section of the manual particularly file_get_contents, or the fsockopen etc.  I'm on a bit of a flyby visit but if I get chance in a bit I'll post an example up to get you started if needed.

Dest

Share this post


Link to post
Share on other sites
[quote author=Destruction link=topic=113159.msg459912#msg459912 date=1162209581]
Okay so what you actually mean is to download an image to your server from another site?  Often called transloading (site->site).  You may want to look at the File Handling section of the manual particularly file_get_contents, or the fsockopen etc.  I'm on a bit of a flyby visit but if I get chance in a bit I'll post an example up to get you started if needed.

Dest
[/quote]
yeah thats wut I mean. an example would be great if you could. I'm not to sure how I would do it.

Share this post


Link to post
Share on other sites
Here's an example directly from User Comments on the File Handling Functions section of the manual.
[code]
<?php
$url = "http://nu-imaging.com/catalog/"; // here we have redirect to /catalog/1/
$fp = fopen($fp);
echo fread($fp, 1024); // we get content of /catalog/1/
fclose($fp);
?>
[/code]

If you wanted to store it, you'd be best storing fread in a variable instead of echo'ing it.  The principle is the same.  However, you will need to have the allow_url_fopen ini option enabled.

Hope this helps, sorry for the delay,

Dest

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.