Question: I have a php script that facilitates uploading of files (jpgs & movie files).

Php script:
<http://pastebin.com/sA6Ewciq>

However, when using a iphone with safari & chrome, it will successfully upload jpgs while not uploading it's \*.MOV format. The server will receive a 0 size of the file, so it connects and creates the file with correct filename, but no data transfer occurs.

This works perfectly fine on Android, Desktops. If I copy the .MOV file that does not work on the iphone and copy to the android it uploads successfully.

This tells me that the php script works right (98% sure) all permissions are correct, but there is something about the MOV format that does not permit copying where JPG's are allowed?

Server version: Apache/2.4.7 (Ubuntu)

Answer: 
This question appears to have been downvoted several times (I don't know why) despite this being a legitimate issue.
Further searching brought up these answers relating to this exact issue, however, it has not been greatly addressed while using php.

<https://github.com/FineUploader/fine-uploader/issues/990>

[Uploading files over HTTP fails on iOS 8.0.0 GM Safari](https://stackoverflow.com/questions/25790873/uploading-files-over-http-fails-on-ios-8-0-0-gm-safari)

<http://blog.uploadcare.com/post/97884147203/you-cannot-upload-files-to-a-server-using-mobile-safari>

It appears the cause is a malfunction with ios requests causing it to fail when the upload script permits multiple file selection as it sends incorrect get requests.

> 
> We can see that the request length should be 134573 bytes (Content-Length header), but as the file is absent from the request and the real length is only 176 bytes.
> 
> 
> 

This explains why the file is 0 bytes but doesn't explain why jpgs work. Oh well

This affects ios 7.\* and 8.0.0

The "fix" involves either using ios 6, or updating to ios 8.0.2 which fixes it in safari but not in chrome.
Videos are larger files then images therefore will require longer time execution.

Because an iPhone has less ressources then a typical PC it will take even longer.

When the maximum time is reached, `PHP` will just quit leaving half-baked uploads behind.

The solution is to extend the maximum execution time.

You do this in PHP ini

```
max_execution_time = 60;in second

```

But you don't have to, you can override it with the following code:

```
set_time_limit(60);//in second

```

Don't forget to reboot the server if you make the change in `php.ini`