# File uploader sometimes fails

**URL:** https://forum.kirupa.com/t/file-uploader-sometimes-fails/301513
**Category:** Uncategorized
**Created:** [December 10, 2009, 2:12pm UTC](https://forum.kirupa.com/t/file-uploader-sometimes-fails/301513 "2009-12-10T14:12:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dhryn](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Dhryn](https://forum.kirupa.com/u/Dhryn)
#### Post date: [December 10, 2009, 2:12pm UTC](https://forum.kirupa.com/t/file-uploader-sometimes-fails/301513/1 "2009-12-10T14:12:22Z")

</div>

I have created my own php file uploader. It is working fine with image files, so far tested with jpg and png.

I am trying to upload zip or rar files which is where the problem occurs. I have successfully uploaded a rar file (1.5mb in size) but when I try to upload either rar of zip of 9mb the php script fails throwing the following error:

Notice: Undefined index: file in C:\wamp\www\dac\game\game\_downloads.php on line 35

That line in my code is the following:

if($\_FILES[‘file’][‘error’] === UPLOAD\_ERR\_OK) {

Both the MAX\_FILE\_SIZE in the form and in the php ini file are set to 10mb.

I have tried may google searches but havent found anything that fixes my problem.

I haven’t added my entire script as it is a bit messy and I am unsure how it can help, but if needed I am happy to added it.

Can anyone see where I am going wrong?
