The upload forms failed to catch errors due to a
never matching condition. Failing uploads (eg. because of
filesize limit etc.) still tried to render non-existing
download links instead of showing the error.
Fix the condition by testing if the return string
starts with "Error" instead of equals "Error".
Refs #96
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
+
+ // if response starts with "Error" then show a failure
+ if (/^Error/.test(res))
res = res.split ("\n");
if (time != 'none')
{
res = res.split ("\n");
if (time != 'none')
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
+
+ if (/^Error/.test(res))
res = res.split ("\n");
async_global_ref = res[0];
var code = res[1];
res = res.split ("\n");
async_global_ref = res[0];
var code = res[1];
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
+
+ if (/^Error/.test(res))
res = res.split ("\n");
var code = res[0]
async_global_transfered = async_global_transfering;
res = res.split ("\n");
var code = res[0]
async_global_transfered = async_global_transfering;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
+
+ if (/^Error/.test(res))
res = res.split ("\n");
if (async_global_time != 'none')
{
res = res.split ("\n");
if (async_global_time != 'none')
{