I am using an API to add text to images which requires a URL to the image. I want to upload my images on imgur so that i have valid URL to use. I am using a php script with imgur as it is a part of an app. Since am using PHP I can easily use command line utilities. Please suggest some solution to this problem.
PS : Don't suggest using PHPGd or imagemagick to add text to image. They do not cater to my need. Also I tried google but most results assume upload to be upload on localhost/server while I want to upload on the net to have a valid URL to use. Also i dont think I have the technical know-how to use a VPS for this purpose.
If you're looking to use HTML/php to allow a user to upload a file to your server, here's a tutorial:
http://www.tizag.com/phpT/fileupload.php/
Please note that this process is unrelated to any image processing you might later perform with a tool such as ImageMagick or GD.
Edit: if you want to use php to make an image available on the Internet, Flickr is not a bad choice:
Uploading a photo with Flickr
ImageMagick is an image manipulation library. It has no functionality to upload files anywhere.
If you want to upload files, then you will need a service to upload them to (finding such a service is off-topic for SO, creating one is too broad for SO, finding hosting for one you create is off-topic for SO).
That service will provide some sort of API (although perhaps not one intended for automated access) which you will have to write a client to interact with.
If said service uses HTTP for uploads, then you should look at the cURL library.
Related
I'm stuck wondering what the best solution is to handling large file uploads and sending them to a third-party API. Any pointers on what would be a good solution would be very welcome. Thank you in advance.
The end goal is to send video files to this API - https://docs.bunny.net/reference/manage-videos#video_uploadvideo. The complication is that the files are often large - up to 5GB in size.
I have an existing website built in PHP7 that runs on a LAMP setup on Amazon Lightsail and I want to add a feature for users to upload video files.
Currently I'm uploading the files directly to Amazon S3 using a pre-signed URL. This part is working fine.
But I need to send the files to the API mentioned above. This is where I get stuck!
I think there's two options to explore - (1) find a way to upload directly to the API and skip the S3 upload or (2) continue with uploading to S3 first and then transfer to the API. But I'm not sure if option 1 is even possible or how to do option 2!
With option 1, I'm wondering if there's a way to upload the files from the users directly to the API. If I do this using the regular HTML form upload, then the files are stored temporarily on my server before I can use cURL through PHP to transfer them to the API. This is really time consuming and feels very inefficient. But I don't know how else to send the files to the API without them first being on my server. Maybe there's an option here that I don't know about!
With option 2, I can already upload large files directly to S3 with pre-signed URLs and this process seems to run fine. But I don't know how I would then send the file from S3 to the API. I can use an S3 trigger on new files. But when I looked at Lambda, they have a tiny file size limit. Because my site is hosted on Lightsail, I noticed they have a container option. But I don't know if that can be used for this purpose and if so, how.
Basically, I'm not sure what solution is best, nor how to proceed with that. And maybe there's an option 3 that I'm not aware of!
I would welcome your input.
Many thanks in advance.
I have a an input for uploading videos on my site. The videos get uploaded on my server and then it is presented via video tag. But as you can imagine, the user uploads only one video with one extension (e.g. mp4), in that case I can't use that video in all the browsers. So, maybe what I could do is upload the same video to vimeo (via their api) and then host this video via "iframe code" or something. My question is: Is it even possible? And is it a good idea?
This is definitely possible, you can and should use the Vimeo API: https://developer.vimeo.com/api
Also it is pretty a good idea, because Vimeo is suited to transcoding and serving millions of videos every day and by definition is way more stable than your own video service. Unless you are facing the legal requirement to host the video on your own server, it is probably better to use external CDN (like Vimeo) for it.
But you will have to use cURL or some other HTTP requests library to access the functions and perform tasks. Check it out here: http://php.net/manual/en/book.curl.php
I have tested and used Google's resumable upload code sample. Based on that, if I use HTML5's upload file API, I would have to upload the file to the server first then post the video's name to Google's resumable upload php file, right? If so, then this would mean a very long upload process because I'm uploading to two servers consecutively.
Hence, my question title. Is it possible? If so, please point me to the right direction or simple tutorials using YouTube API v3 to get started. Thank you very much!
P.s. I've heard of Zend Framework but I don't want to install the whole thing just to use a simple YouTube upload. Please guide me by extending the usage from Google's code sample.
Two possible approaches right now.
Browser based upload via YouTube API v2 (scheduled to be removed april 2015)
https://developers.google.com/youtube/2.0/developers_guide_protocol_browser_based_uploading
CORS upload with API v3.
SO Question with details
Is there any possiblity to create a thumbnail of uploaded video file in php without using ffmpeg.
Most server side scripts rely on ffmpeg, so if you can't use that you can either upload the video to an external service but that would mean sending the whole file OR you could try creating them client-side in the browser -- Generate thumbnails from video files using HTML5's video tag and canvas
If however you can't use ffmpeg for installtion reasons you could look at a wrapper -- It currently provides FFmpeg-PHP emulation in pure PHP so you wouldn't need to compile and install the module.
In the past I have used this website to do video conversion and create thumbnails. It works very well and have both free and paid plans.
The system consists of several "robots" that do different jobs. These robots can read your videos if you put them in a public folder with an URI or Amazon S3 for example. The actions that the robot must do are defined in "templates" in JSON and have a PHP SDK. Have a look at the docs.
P.S: I'm not related with transloadit, seems like I am a commercial guy...
I have many many pdf files around 50GB in my Ebooks folder.
Now i want to upload them in Google docs like Rsync of Linux.
Is it possible to have the script in php or python which uploads all pdf files in Ebooks folder and subfolders to Google docs.
Now the problem is i need to restart computer many times and i want that script should start from where it was left with previous file so that i don't need to manually make selection of files. is it possible
You'd use the Google Documents API to upload them using a simple HTTP POST with the data. Here's an explanation how to upload and convert documents: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDocs
The link will provide you will examples and all you need to do what you were asking for.
To be more precise this is what you are looking for if you want to upload pdf's: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#ResumableUploadPUT
Python Google Documents API guide
PHP Google Documents API guide