Deserteye Posted October 29, 2006 Share Posted October 29, 2006 how would I upload a file using a link? Quote Link to comment Share on other sites More sharing options...
Destruction Posted October 29, 2006 Share Posted October 29, 2006 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 Link to comment Share on other sites More sharing options...
Deserteye Posted October 30, 2006 Author Share Posted October 30, 2006 [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? Quote Link to comment Share on other sites More sharing options...
Destruction Posted October 30, 2006 Share Posted October 30, 2006 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 Link to comment Share on other sites More sharing options...
Deserteye Posted October 30, 2006 Author Share Posted October 30, 2006 [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. Quote Link to comment Share on other sites More sharing options...
Destruction Posted October 31, 2006 Share Posted October 31, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.