Link to home
Start Free TrialLog in
Avatar of Ryan Bayne
Ryan BayneFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CSV File Fails To Upload

Hi

I attached the csv file that fails to upload. Any other csv file will upload just fine.

wp-posts.csv

The difference is probably encoding but I wanted to confirm this or get another reason why $_FILES['file'] shows a fail straight away with this file and not many other csv files I have.

Also what is the best way to properly dedect the reason so I can notify the user?

Thank you for any help
Ryan
ASKER CERTIFIED SOLUTION
Avatar of Scott Madeira
Scott Madeira
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Stanyon
Without seeing more code, or specific errors, it's difficult to tell what could be causing your problems. Turning on error reporting in PHP may help by outputting any errors to the screen.

To turn on error reporting, add the following lines to your php script and then try running your upload again.

Also, the default upload limit for sending files is 2mb. Unless you've changed this, that could also be the problem (the file you've attached is 5.7mb).


ini_set('display_errors',1); 
error_reporting(E_ALL);

Open in new window

Avatar of Ryan Bayne

ASKER

Your file size  suggestion got me thinking, what if the file size limit being shown to me on the page is not the limit being enforced.

That is what the issue is. I'm displaying the servers limit as 30mb but in fact it is really 2mb. It is a developer plugin I tested to see how easy it could increase the limit. I just assumed it worked and forgot about it.

Thanks for jogging my memory.