Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSV File Fails To Upload

Posted on 2011-03-22
3
Medium Priority
?
302 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 500 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 44

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 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