title: How do I manually create an $_FILES file object?
body: <p>I'm hacking Chamilo so it automatically imports an iCal file when the user views their personal agenda. So far I've been able to pin-point the functions that I need to call in order to make this happen.</p>
  
  <p>However, the function that does the actual importing expects a reference to a file object from the <code>$_FILES</code> superglobal. It gets the file name from <code>$file['tmp_name']</code> and calls <code>file_get_contents()</code> on it.</p>
  
  <p>I've thought about duplicating the function and altering it so it expects a regular file object, but that seems a poor way of handling it. A better solution would be to construct the file object that it expects. But I have no idea how to do that, and googling hasn't helped.</p>
  
  <p>Does anyone have an idea?</p>