Upload an image using a URL in Codeigniter - php

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?

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/

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.
File Uploading Class
Note: My english is off. Sorry for that.

Related

How to get actual image from local path in PHP?

Disclaimer - Thanks for coming to this question! I would just like to say that I am an absolute beginner to PHP. Thanks!
Hi! I am working on a project (more specifically, a mobile-only App), in which I need to do the following things -
The user would give me his/her phone's path to the image, which is stored in his mobile.
Through API, I would send the path to my website's PHP file, and the PHP would capture the image from the path.
After displaying the image, the code would compress it with very high compression, and display the temporarily store the image.
Then I would upload the image to AWS S3 media database(maybe with PHP SDK?), and obtain the image's link.
So that's my plan, is it possible to do? And what are the steps to do the 2nd & 3rd step - i.e. catching the image from the phone's local path, and compressing it?
Any help is appreciated :)
Thanks a lot!
There is no possibility for you to remotely access any known mobile operating system's storage.
You want to upload a photo and process it - just do it! You can simply send the photo through your API to the PHP server, and it would receive it as it would receive any other file, e.g. from a website form.
Then, you use some tool like Imagick to edit the photo.
You return thumbnail to the user within the response of your API.
Yet simpler, isn't it?

Adding image upload to html page (mysql backend)

Relatively new to web development here, but am trying to implement an image upload feature, the contents of which will be previewed to the person (administrator) uploading the image, and then stored in a database (and displayed to the end user on a different page).
I found a resource that uses a Imageshack API, and was a bit confused about what this is and how the person implemented the API to achieve the image upload. The code for this is here: http://www.sceditor.com/posts/how-to-upload-and-insert-an-image/
When I googled "Imageshack API," I kept running across something that said I need to request a key. What does this mean, and do I have to do it? Is this the easiest way to go about creating an image upload feature for my purposes?
Thank you all very much!
Imageshack API is for uploading image files to your account hosted at Imageshack.com. It seems that you want to upload image files to your own website and store such files on your own web servers (either in a cloud service such as AWS or your co-located/managed servers at some data centres). So, you probably do not want to use Imageshack.
As to how to upload image files using HTML & PHP, you may want to check out a short tutorial at:
www.w3schools.com/php/php_file_upload.asp
Also, by the way, storing image files into a database such as MySQL may not be a good idea -- image files should be stored as files. It is faster to access such image files on a web server than to access image contents stored in a database.

Symfony2 upload file without form

Using symfony2, I would like to upload some files only from their path on my PC.
I read an excel file containing some path to pictures (like /home/thibault/pictures/*.jpg) and I want to upload them on my server. So, I do not want a form.
All the documentation I have read deal with upload from a form, is this possible to do that without ?
Thanks in advance,
No it is not possible. For what you are looking for you need to deploy some locally running agent. Any browser will not permit you to pull files form folders on the user's computer. The user has to be the one to say what files they want to upload if it is to be done inside a browser.

Saving uploaded media content

I'm making my own website using html and php, and a database using mysql on localhost on a easyPHP server. Users can make an account and upload videos on the site.
I'm wondering if it would be possible when they upload the file, it would upload the file to youtube and I can just save that link in my database. Then on the content page I could just use that link to show the video in an embedded player.
If that's not possible, what would be the best way to save the content in a folder on my PC?
Thanks
Yes, Youtube allows uploading video files directly to Youtube's servers, bypassing your server.
This page documents it pretty well: https://developers.google.com/youtube/2.0/developers_guide_protocol_browser_based_uploading

Can I navigate Image Uploader with cURL?

I'm wondering if anyone knows if manipulating the Aurigma Image Uploader using cURL is possible. Basically what I need to do is transfer images that are uploaded to my site (not using aurigma), and using web scripting (I'd assume cURL) send those photos to another site that is password protected but that uses Aurigma Image Uploader to receive photos. So I would need to be able to navigate to the correct upload folder on my desktop, then select all the photos in that folder and then upload them. I can't connect to the server directly using POST, so that option is out of the question. So any advice on how to accomplish this would be great. Thanks.
EDIT
To explain the process that needs to happen. Site/Server 1 receives images that are uploaded to it from users using a generic image uploading script. Site/Server 2 receives images that are uploaded to it via the Aurigma Image uploader. My question is whether a script can be created to transfer directly the images received on Server 1 to server 2? The script would see the uploaded images on server 1 and then navigate through the password protection on server 2, navigate to the area of the site to upload, then use the site's installation of Aurigma Image uploader to choose the images that were uploaded to server 1, select them, then upload them to server 2 using the aurigma image uploader.
I cannot access the server directly through POST methods, that is why I need to basically walk through the site using a created script, then have the script control which pictures to upload to server 2 based on what was uploaded to server 1. Clear as mud? :)
If I understand you right, you want to upload photos from server 1 (where you upload images using ‘web scripting’) to server 2 (‘another site that is password protected’) using Aurigma Image Uploader. Image Uploader does not support adding files to upload list from Java Script, this way, you cannot select files and initiate upload from your code.
Image Uploader sends files using HTTP POST requests, so you can try to form your own request compatible with Image Uploader API: POST Field Reference.

Categories