Solved

CSV File Fails To Upload

Posted on 2011-03-22
3
290 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Ryan Bayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 125 total points
ID: 35194984
Check your maximum file upload size and then compare that to the size of this file and the other CSV files you are uploading.  The attached CSV is 5.7 MB.  If your limit is set to 4MB that would cause a problem.

you can get max file size from php.ini or run a phpinfo() script...
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 35195020
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

0
 
LVL 2

Author Comment

by:Ryan Bayne
ID: 35197545
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.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question