Vimeo PHP Upload Directory - php

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 :)

Related

Handling large file uploads and sending to API

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.

posting dynamically to S3

Good afternoon!
I am trying to replace my host with an S3 Amazon service for images. The website currently uploads images successfully using an uploader without problems. So the questions I have are about migrating from host to S3. Trust me I have read the Amazon support blogs and searched the net. But I can find no single, concise, or easy to understand technical advice--just a lot of Amazon jargon.
For info, at the moment the uploader does the two things you would expect it to do well:
1) it uploads the files to a target folder to the specified (Define) UPLOAD path(no problem)
2) it generates the image POSTS ready for processing (no problem).
It is a nice uploader with lots of goodies for image management so I don't want to replace it- I simply want to build a bridge from the outputs it creates (as above) into Amazon S3?.
So my specific questions are can anyone tell in simple terms how to:-
..enable users to Upload the images posted by my uploader to Amazon S3
..Allow users to get images back via their own dynamic page views.
Many thanks in anticipation
ps for info this is the uploader but im not sure that is needed bearing in mind it works as expected and produced the outputs above and I cannot replace it at this stage of the development process.
https://github.com/blueimp/jQuery-File-Upload

How do I upload directly to YouTube without uploading to server first?

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

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 images into my remote server with PHP?

I have an android app, that connectos to the remote database with PHP+json
but now, i have to store photos of the users on the remote server. I need to do it storing the URL of the uploaded photo in a row of the USER TABLE. That is not the problem. The problem is that i have not idea about with a given path of a photo, how to upload it into a dir of the remote server of my app?
as i know, i need two things, a function that connects with a PHP and gives to the PHP the photo, and a PHP that receives the photo and uploads it into a dir of the remote database.
Well....¿can someone help me to do it?
I checked a lot of tutorials of doing this with PHP but i can't find a easy one that how to do it with android+php+mysql, all i am finding is too hard for me.
can someone give me the code i need to do it?
thanks
EDIT:
there does not exist a simple function and a simple PHP code that does it? Simple ones, the examples you are giving me are very hard for my skills with this and i can't apply to my android app and my remote server
For the Android part, its just straight Java, and there are loads of examples of using HttpClient to perform file uploads.
How to upload a file using Java HttpClient library working with PHP - strange problem
google search
For the PHP side: http://it.php.net/manual/en/features.file-upload.php (there are a lot of sample)
For the Android side: this article explains hot to use DefaultHttpClient for make and upload via HTTP

Categories