I went through the tutorial to upload an image in Codeigniter with the Upload library, but I was wondering: Is it possible to upload an image using a URL in Codeigniter?
-
What does this mean exactly to "upload an image using a URL"? Can you give an example? – Wesley Murch Aug 25 '11 at 06:19
-
@Wesley Murch: See http://imageshack.us/ -- it's probably like that, where the user has the option to upload a file from their computer or link / retrieve an existing one from a site. – stealthyninja Aug 25 '11 at 06:30
-
@stealthyninja: yes its like that. is it possible in codeigniter using the existing library? – insomiac Aug 25 '11 at 16:26
-
@wesley murch: similar to what stealhyninja mentioned.. – insomiac Aug 25 '11 at 16:26
-
@Aby: See the links in my answer below -- http://stackoverflow.com/questions/7185845/upload-an-image-using-a-url-in-codeigniter/7186033#7186033 -- you could use the Curl library to download a remote image. – stealthyninja Aug 25 '11 at 17:32
2 Answers
Yes, it's possible. See the answer on this question: Saving image from PHP URL.
If you're going to go the cURL route, see the CodeIgniter wiki entry: http://codeigniter.com/wiki/Curl_library/

- 1
- 1

- 10,343
- 11
- 51
- 59
If I understand your question clearly;
I think Upload a file using URL isn't a properties of Codeigniter or any other technologies. It's about operating system.
For example, you have a upload system with generated by PHP and Codeigniter. When you click Browse button, you can select an image in your computer or you can write an image link hosted on the internet. When you insert an image link, operating system generate a temporary path source (with your image) in your computer. In Windows, this could be C:/Temp
folder. Then you can upload your image which you insert its' link.
Note: My english is off. Sorry for that.

- 97,193
- 102
- 206
- 364