Magento : Product images not uploading

When trying to upload an image for the product the section with the image name gets a red border and an error message appears.
When trying to upload something for the downloadable products same error found.

Here is what I did to fix it:

The problem seems to be caused by the prototype v1.7.
It works great with prototype 1.6
Get the 1.6 version from here
or get it from older magento version.

Create this file: js/prototype/prototype1.6.js and put the contents from the link above in it.
Now edit app/design/adminhtml/default/default/layout/main.xml and change this line


I don’t think it’s a problem if you edit this core file.

I hope this helps someone :).