User Tools

Site Tools


Sidebar

tutorials:image_upload_problems:start

This is an old revision of the document!


Image Upload Debugging

The software now has two ways for clients to upload images into your site. What we call the "Legacy Uploader" and the new "Standard Uploader" introduced in version 4.1. The new standard uploader will give your users a more fluid experience to your site eliminating many "white screen" error your clients may have seen with the legacy uploader. But with either method of uploading problems can occur until the site is properly configured to handle uploaded files.

The first step to addressing any photo upload problems is to make sure settings in the following admin tool are correct:

LISTING SETUP > FILE UPLOAD & DISPLAY SETTINGS

Specifically the following settings:

LISTING SETUP > FILE UPLOAD & DISPLAY SETTINGS > Photo Directory URL LISTING SETUP > FILE UPLOAD & DISPLAY SETTINGS > Server Path to Root of Photos Directory

You can find more about these settings in the above wiki manual links.

Once you have the above settings correct how to determine the image upload problem may depend on the method you have chosen to allow clients to upload images. No matter the uploader chosen all the image problems outside of the above configurations will involve adjustment to settings within the php configuration. Inside the php.ini php configuration file if not somewhere else within the server configuration.

Standard Uploader Debugging Messages

One of the reasons we created this uploader was to head off some of the problems clients were having with the legacy uploader. Within the current standard uploader the client should never see a "white server error" page or empty page with only a "cryptic" php error message. The current standard uploader also forces the client to upload images individually stopping many of the timeout errors encountered by the legacy uploader when multiple images were uploaded at one time.

This uploader replaces those "ugly" error pages or sometimes blank screens, with a more user-friendly error message displayed inside a box on the current page. Sometimes the error message will have text similar to "Error Code 3" at the end, when that is the case you can reference the table below to see what the error number signifies.

"Error Code #" Code Number Reference:

Num. Explanation How to Fix
1 The uploaded file exceeds the upload_max_filesize directive in php.ini. Increase the value for upload_max_filesize in php.ini configuration.1)
3 The uploaded file was only partially uploaded. If this continually happens, contact your host.
6 Missing a temporary folder. Contact your host to resolve.
7 Failed to write file to disk. Contact your host to resolve.
8 File upload stopped by extension. Contact your host to adjust the server configuration.

See http://php.net/manual/en/features.file-upload.errors.php for full reference.

If you do not get an error code, and the error message says there was an error processing the image, this usually means there was a PHP error, in which case you will need to look within the php error_log file for the error.

Simply uploading one image at a time cuts down on many errors. So debugging issues within the standard uploader are much fewer with respect to "php timeout" issues.

Legacy Uploader Debugging Messages

If an error happens using the legacy uploader you are most likely to see a "white page". This means that a server error has happened in processing the form page/image upload request. An error has happened and the server has stopped php execution. PHP always provides an error message but where this used to be predominantly displayed to the browser (unless configured otherwise) those messages are predominantly "written" to a php error log. While this may seem more painstaking to find the error message and debug this issue it is done to protect your server further. Hackers can use these error messages to learn about server configurations. So these error message have almost solely been written in error logs so only server admins and those with ftp access can view them.

Error Message Contents

Memory Allocation

The vast majority of image upload issue fall into the "php memory allowed" category. If the error message you see contains "memory allocation" you will need to increase the php memory limit value within your php.ini file. This error is better explained in the support wiki here:

PHP Memory Limit Error When Using Software

Timeout

The next most "popular" problem in uploading images to the site is that there is not enough time for the image to upload to the site before php itself times out waiting for the upload. You generall see "max execution time" exceeded within the php error you see.

One of the most important php configurations is the amount of time that a routine should stay "open" before it is automatically closed. The default php timeout is 30 seconds on almost all server configurations we have encountered. This is usually good enough for most single images to make it to the server. With the standard uploader this will be less of a problem as images are uploader individually. With the legacy uploader the timeout limit becomes more of a problem as all images must make it to the server before the timeout. Many times with the legacy uploader some images may make it fully uploaded to the server before timeout. When this happens your clients will get the "white screen" error and only some of the images appear in their listing.

To fix this issue you will need to increase the max_execution_time value in your server's php configuration php.ini file. As we have said 30 is the default value. The next value we suggest in 60 (for 60 seconds) and if some of your clients still have an issue because of slow Internet connections you may need to increase this value further.

1)
You may need to contact your host to make this adjustment.
tutorials/image_upload_problems/start.1253814749.txt.gz · Last modified: 2014/09/25 16:55 (external edit)