Omri Spector
Omri Spector

Reputation: 2561

PHP upload file fails in iframe

I have an html page which POSTS files to a PHP backend - either using Ajax or through a hidden iframe.

Using Ajax I can upload files up to the limits set in my .htaccess (10M)

When I use IE - files above 2M are rejected with "Error 1:The uploaded file exceeds the upload_max_filesize directive in php.ini".

It's as if requests passed with

Content-Type: multipart/form-data; boundary=---------------------------7db16f8c3114c

See a different PHP.INI setting than those that are

Content-Type: application/octet-stream

This is especially troublesome since IE cannot use XHR - so a large part of my users can't upload large files.

Any idea why this is happening?

Technical details:

Upvotes: 0

Views: 444

Answers (2)

Zencode.dk
Zencode.dk

Reputation: 1364

...and make sure to change both of the php.ini files..

The one in the Apache folder, and the one in the PHP folder..

Upvotes: 0

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29965

Make sure that the backend doesn't use ini_set to change the upload limit again. Also make sure that the .htaccess file is in the right directory.

Upvotes: 1

Related Questions