# PHP Script Fore Flash 8 Upload issue

**URL:** <https://forum.kirupa.com/t/php-script-fore-flash-8-upload-issue/168962>\
**Category:** programming\
**Created:** [November 11, 2005, 4:37pm UTC](https://forum.kirupa.com/t/php-script-fore-flash-8-upload-issue/168962 "2005-11-11T16:37:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hogfish](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@hogfish](https://forum.kirupa.com/u/hogfish)\
**Post date:** [November 11, 2005, 4:37pm UTC](https://forum.kirupa.com/t/php-script-fore-flash-8-upload-issue/168962/1 "2005-11-11T16:37:54Z")

</div>

\*I am having issues uploading files larger than 20MB. I am not sure what else I am doing wrong. The files I am trying to upload are video files. .mov, .flv and .mwv. I am able to upload images good and great but I need help uploading videos too… Please help I am exhausted… ☹

\<?php

$MAXIMUM\_FILESIZE = 1024 \* 200000; // 200KB  
$MAXIMUM\_FILE\_COUNT = 10; // keep maximum 10 files on server  
echo exif\_imagetype($\_FILES[‘Filedata’]);  
if ($\_FILES[‘Filedata’][‘size’] \<= $MAXIMUM\_FILESIZE) {  
move\_uploaded\_file($\_FILES[‘Filedata’][‘tmp\_name’], “./temporary/”.$\_FILES[‘Filedata’][‘name’]);  
rename("./temporary/".$\_FILES[‘Filedata’][‘name’], “./images/”.$\_FILES[‘Filedata’][‘name’]);  
}  
$directory = opendir(’./images/’);  
$files = array();  
while ($file = readdir($directory)) {  
array\_push($files, array(’./images/’.$file, filectime(’./images/’.$file)));  
}  
usort($files, sorter);  
if (count($files) \> $MAXIMUM\_FILE\_COUNT) {  
$files\_to\_delete = array\_splice($files, 0, count($files) - $MAXIMUM\_FILE\_COUNT);  
for ($i = 0; $i \< count($files\_to\_delete); $i++) {  
unlink($files\_to\_delete[$i][0]);  
}  
}  
print\_r($files);  
closedir($directory);

function sorter($a, $b) {  
if ($a[1] == $b[1]) {  
return 0;  
} else {  
return ($a[1] \< $b[1]) ? -1 : 1;  
}  
}  
?\>\*
