Uploadify HTTP Error 412

November 3, 2010 § 2 Comments

Few days ago I encounter the HTTP error 412.

It’s so weird that I uploaded few JPG files without error, except one which is JPG as well.

After I exported to PNG , it works again.

Got tips from a friend as following.

This is caused by mod_security, which is used for blocking spam , but sometimes it got triggered by accident.

For quick and dirty fix, you could  edit your .htaccess. and add following

SecFilterEngine Off
SecFilterScanPOST Off

And if you are interested about the issue, you could look at following link

http://help.joyent.com/index.php?pg=kb.page&id=85

In summary, the mod_security will determine if the request is spam by looking at the URI / POST.

For URI like “-poker” or “-sex”, mod_security will be triggered and blocked visiter to execute such action.

In long one, one should not disable the mod_security as it provides minimal protection from spam. Starting looking at the URI or POST that might trigger the mod_security and add following lines.

In our case

SecFilterEngine On
SecFilterSelective "POST_PAYLOAD" "KEY WORD" "allow,nolog"

replacing the keyword with the one you think may trigger the mod_security. I think this is a better practice at last.

jQuery Uploadify – A handy dandy tools for upload to your own place

February 23, 2010 § Leave a comment

Uploadify is an open source jQuery plugin and very easy to use.

You may follow the link http://www.uploadify.com/

The installation and basic usage you can also find it in the hosting site.

Couple things share I would like to share

1.Debug script

$(document).ready(function()
{ $('#fileInput').uploadify({
'uploader'  : 'uploadify.swf',
'script'    : 'uploadify.php',
'cancelImg' : 'cancel.png',
'auto'      : true,
'folder'    : '/uploads',
'onChange' :function(eventObj, queueID, fileObj, response, data)
{
alert('File Name:'+fileObj. name);
alert('File Path:'+fileObj. filePath);
alert('Server Response:'+ response);
}
});
});

2. Testing on Localhost works perfectly, but a mess in actual deployment

Uploadify is just great treat for every developer, but when it comes to actual deployment it is a pain.

There are couple error you can get ‘HTTP’,’IO’ or ‘Security’.

I encounter HTTP error 500, still looking for solution to overcome this.

Where Am I?

You are currently browsing entries tagged with uploadify at Nick Wan L.K..