This topic describes different approaches to solving the issue when Image Uploader is unable to successfully upload files and displays the following error message:
As well, sometimes you may see the message saying that upload is successful, but files appear to be not uploaded; this may indicate a server error but not necessarily.
In this case, please, firstly check that you specified at least one converter, your upload script really saves files, and you are looking for files in the correct folder.
Here are the most probable issues causing the server-side error:
If you experience an issue having different sympthoms than those described in this article, please, see the Basic Steps in Troubleshooting topic.
Here we consider the following approaches to handling and debugging server-side errors:
Image Uploader provides two events which are helpful for debugging, namely, Error and AfterUpload. The first one fires when a server or client-side error occurs, and the second fires when an upload is supposed to be successful. We recommend to handle both events simultaneously to get debug information on server errors.
The Error event provides detailed description of an occurred error through the errorPage parameter
which represents the web page returned from the server. To ignore non-server errors you can use the errorCode argument, since it is equal
4 in case of internal server error. For the full list of error codes, please, see the Error event parameters paragraph.
The idea of catching errors via the AfterUpload event is as follows:
Let us presume that server-side upload script returns a
"complete" string (predefined response) after all the uploaded files were saved, then
the following code will show error details if a server-side error occurs.
As an example of network analyzer tool we use the Fiddler. Here we discuss how to use it to debug server-side upload script.
Double-click the session with server error in the Web Sessions pane.
Find upload session details in the left part of Fiddler's interface. Here it contains the POST request sent by Image Uploader and the response returned by your upload script. If your upload script contains an error this error details will be displayed in the returned response.
You can use the debug class and the error console of browser to view Image Uploader error and warning messages along with the response returned by your upload script.
In order to do it you should, firstly, insert the following code before rendering Image Uploader:
Secondly, open the console. Here are the ways to open the console in the most popular browsers:
If your browser has no error console, please, allow pop-up windows in your browser.