Jump to content

file upload


Deserteye

Recommended Posts

[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?
Link to comment
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
Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.