Skip to content

Instantly share code, notes, and snippets.

@jawngee
Created July 16, 2009 07:19
Show Gist options
  • Save jawngee/148298 to your computer and use it in GitHub Desktop.
Save jawngee/148298 to your computer and use it in GitHub Desktop.
<?
class SomeController extends Controller
{
// Upload an xml file and parse it
public function post_index()
{
foreach($this->request->files as $name => $file)
{
// moves to app's temp directory
$file->move();
if ($file->type=='text/xml')
{
$xml=$file->contents();
// parse $xml
}
// delete the file
$file->delete();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment