User Tools

Site Tools


Sidebar

tutorials:image_upload_problems:start

Image Upload Troubleshooting

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.

No "error code":

If you are getting an error message similar to2):

Server Error occurred while processing!  Please try again with a smaller file, and make sure the file is not corrupted.

This means that the uploader did not get back any meaningful error messages, such as "wrong file type" or an error code as mentioned in the previous section. To narrow down the possible causes of this, attempt to upload the same file using the Legacy Uploader:

  • Do you have basic authentication on the directory you are using the software on? If so remove it for a test. The flash uploaded does some behind the scenes communication with the server to hide any errors from direct client view and basic authentication can corrupt that communication.
  • If the Legacy Uploader produces a white screen or PHP Fatal Error: There was a PHP error such as running over the memory_limit, a timeout error, or something like that which stopped the rest of the script from continuing. You will need to make sure that PHP error logging is turned on, and look within the php error_log file for the error, or if the legacy uploader displays a Fatal Error that would also point to the problem.
  • If the Legacy Uploader works but the standard uploader does not:
    • The most common culprit is "mod_security" blocking access. You can try turning off mod_security, or contact your host to adjust the mod_security configuration to allow Flash-based uploads to work3). Your host will need to look at the mod security logs to find the reason for the block, then adjust the configuration so that it no longer blocks based on that "criteria"4). If you just want to turn it off real quick to see if that fixes it, with most hosts, mod_security can be turned off by adding these 2 lines to your .htaccess file at the top5):
      SecFilterEngine Off
      SecFilterScanPOST Off
    • It could be the server "sent" the information back just fine, but the response is being inadvertently blocked by certain types of software running on the computer. It could be a software firewall, ad-blocking or JS blocking software installed, or it could be a virus scanner that has "Internet Security" built in that might be blocking it from working. You would need to check for any such software that might block things from loading on your computer, and temporarily disable them one by one, until you find the one that is stopping it from working.
    • If you have added a <base> tag to the template used on the image uploader page, and the URL is different than what is used on the site, for instance it has www when the user is browsing without the www, or visa versa, or there is a typo or some other problem with the URL used in the base tag. The fix is to remove the base tag from the template. If the base tag uses a different URL then the browser actually blocks certain things from working for security reasons.
    • If you have added a <base> tag to the template used on the image uploader page, and the URL uses https: it will break things. The fix is to remove the base tag from the template. The standard uploader does not work in SSL, due to problems with Flash not working correctly in SSL. The software adjusts for this, dropping out of SSL mode for the image upload page, but if you have a base tag in your template that uses https in the URL it will still cause it to break.

If you are still having trouble finding the cause, another thing you can try with the standard uploader is to turn on "debug mode":

In the overall template used for the image upload page, by default this is the "basic page with my account links" template, edit the template and add the following right above the </head> tag in the template's HTML:

<script type="text/javascript">
Event.observe(window,'load',function () {
geoUH.debug = true;
});
</script>

Save the changes, then test uploading the image, and if that was inserted correctly, the error message it gives should have additional "debug" information which might help to point to the problem, whether it be running out of memory or timing out or what.

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.
2)
This error message could have been changed in the admin panel, the exact text referenced is the default text.
3)
This was first reported in this forum post
4)
We have found that what configuration changes are needed will vary from server to server, the most common problem is a red flag thrown by the user-agent used by Adobe Flash Player uploads
5)
You may still want to find a more "permanent" solution if this is the cause, by talking to your host. Note that for some hosts, adding the lines to the .htaccess file is the only solution.
tutorials/image_upload_problems/start.txt · Last modified: 2014/09/25 16:55 (external edit)