php: equivalent of $_FILES upload?
<p>I have to send a file to an API.  The <a href="http://developer.brightcove.com/en/articles/easy-video-uploads-echove-sdk" rel="nofollow">API documentation</a> provides an example of how to do this through a file upload script ($_FILES).  But, I have the files on the same machine, so would like to skip this step and just read in the file directly to save time.</p>

<p>How can I read in the file (a video) so that it will work with this code snippet?</p>

<p>I understand that FILES is an array, but I could set the other parts of it (the filename) seperately, I just really need the data part of it to be read in the same format to work with this code (do I use fread?  file get contents?)</p>

<pre><code>&lt;?php

# Include &amp; Instantiate
require('../echove.php');
$bc = new Echove(
    'z9Jp-c3-KhWc4fqNf1JWz6SkLDlbO0m8UAwOjDBUSt0.',
    'z9Jp-c3-KhWdkasdf74kaisaDaIK7239skaoKWUAwOjDBUSt0..'
);

# Create new metadata
$metaData = array(
    'name' =&gt; $_POST['title'],
    'shortDescription' =&gt; $_POST['shortDescription']
);

# Rename the video file
$file = $_FILES['video'];
rename($file['tmp_name'], '/tmp/' . $file['name']);
$file_location = '/tmp/' . $file['name'];

# Send video to Brightcove
$id = $bc-&gt;createVideo($file_location, $metaData);
</code></pre>

<p>?></p>

<p>Thanks in advance for any help!</p>
