Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSV File Fails To Upload

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

824 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