How do I upload directly to YouTube without uploading to server first? - 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

Related

PHP Google Drive Simple Upload

I am new here and newbie in Google Drive thing. I managed to follow and install Google Drive v3. Now, I am stuck as to how can I make a simple PHP code that will upload a text file to my Google Drive. I need a simple PHP code / guide on how to upload a small text file. Please help.
Thanks in advance.
If you want to know how to upload file, then you can check the DRIVE API documentaion for that.
Here you can find 3 options on how to upload file.
simple upload
multipart upload
resumable upload
Just visit the above link to know more about them.
For the PHP code that you want, then you can check the answer in this SO question.
Just remember that you need to set <YOUR_REGISTERED_REDIRECT_URI> to the document to authenticate it.
For more information or other way to upload file using service account, check this SO question.
If you want to understand the process of file upload on google drive.
There is a repository on GitHub on how to authenticate and upload files on google drive using Google Drive API in PHP. You can give it a try.
https://github.com/SM4991/php-google-drive

How to post images to users' wall (or in folders/albums) on Facebook (2013)

I am using Facebook's PHP SDK. I looked here (official documentation by Facebook) for help. It is not working for me because I am using images hosted externally but if I try to upload files hosted within my server then it works fine.
Is there any new way to do this. Please try to explain both (Posting to feed and to some folder/album). Sorry for this question but others here were of no help to me.
Please suggest any PHP editor that is compatible with Facebook's API. (Auto-completion etc.)
Stack is normally for solving small issues (think using = rather than > in a query) not a complete project.
Have you attempted writing this code yourself, if so what errors is it spitting out? rather than saying it doesn't work.
If the images are stored somewhere out there, you need to download them to your server and upload them to FB. You can't just tell FB an URL of an image, it's not working like this.
In order to upload fotos, you may use the "photo post" Method on the FB API. And it wants the binary data of the image. You may link an input and an output stream to that (what I would prefer using Java since no storage is needed).
Since your code is working with locally hosted images, just encapsulate that part and make the external image an internal one first.

how to upload a image on imagemagick

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.

Vimeo PHP Upload Directory

I have spent this best part of a week rattling my brain to get this working and I've just come to the conclusion that this is out of my scope. I know this is a rather large ask but I just can't figure it out. :(
Anyway, I am trying to upload some files in a directory on my webserver to Vimeo through a protected php script (I say protected because the script itself will not be accessible from the web) and have that script run via a cron job. The script will only upload to my account.
I have gotten as far as getting a consumer key and consumer secret from vimeo.
I have been attempting to use their documented API demo but that keeps requesting an oauth_token and oauth_token_secret, both of which I don't know how to obtain. I found it quite confusing and unsure if I could adapt it for my requirements. Instead, I googled and found this blog post about transfering files from youtube to vimeo - http://mclear.co.uk/2011/05/27/transfer-videos-from-youtube-to-vimeo/ - I thought I could use it as a building block but I've hit a dead end here also.
To explain the full scale of what I'm trying to achieve:
Video file is created on originating computer - Working
User adds ID3 tags to the file and drops it in a watched folder - Working
Local server sends the file via ftp to the webserver directory - Working
Php script reads the ID3 for the file and uploads it to vimeo - [ID3 Extractor working -Vimeo uploader not working]
Vimeo responds with upload location to script which then connects to our mysql server to add the record - Not working but straightforward to implement once uploader works
Thank you so much in advance for any help you can give.
Richard
I made some progress on this with the php "Transfer Youtube to Vimeo tool" I made
The download at the bottom of the article will get you uploading w/ PHP
The CLI tool is now available and comes with a video tutorial for how to use it.
Credit to #TomNomNom
Please don't contact me RE this I'm not supporting this code it was just hacked together :)

Uploading a photo with Flickr

I just started working with the Flickr API today and I have a question:
If I allow a person to upload a photo to my website and then in order for me not to store it on my small local server, how can I just upload that photo to Flickr using the PHP Flickr API?
That should be a pretty common use case, correct? I use PHP.
Thanks,
Alex
Flickr Upload API:
http://www.flickr.com/services/api/upload.api.html
Simple php script to upload pics on flickr
http://www.flickr.com/groups/api/discuss/72157621716056865/
Maybe this will point you in the right direction since depending on what you want to do with your files after you upload them.
Have you checked out the documentation for the API. I've worked with it in the past, you don't need to download the image yourself you upload it and send it straight to Flickr.

Categories