# fileReference

**URL:** <https://forum.kirupa.com/t/filereference/208023>\
**Category:** flash\
**Created:** [November 24, 2006, 3:37am UTC](https://forum.kirupa.com/t/filereference/208023 "2006-11-24T03:37:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rille31](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rille31](https://forum.kirupa.com/u/rille31)\
**Post date:** [November 24, 2006, 3:37am UTC](https://forum.kirupa.com/t/filereference/208023/1 "2006-11-24T03:37:43Z")

</div>

Im uploading with the fileReference and want to check the mime type for security reasons.

The php code work in a regular html/php form but the same code doesnt work with the swf file, when I comment out the mime checking code it also works i flash.

Anybody know why this happens?

```php
$fil = $_FILES['Filedata']['name'];
if (preg_match("/\.(?:txt|doc|pdf)$/i", $fil)){ $mime = $_FILES['Filedata']['type']; 
  //this doesnt work from flash!
 $mime = $_FILES['Filedata']['type']; 
  if($mime == "application/msword" || $mime == "text/plain" || $mime == "application/pdf") { 
 move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
  }
} 

```
