Drupal Filefield won't upload javascript files?

Posted by hfidgen on Stack Overflow See other posts from Stack Overflow or by hfidgen
Published on 2009-09-04T09:46:58Z Indexed on 2010/03/22 2:41 UTC
Read the original article Hit count: 424

Filed under:
|
|
|

Hiya,

I've got a site where individual pages might require some javascript or CSS files hooked into their heads. I'm trying to keep everything client side when it comes to managing this process, rather than getting on the FTP and sorting everything out in the code so I need to be able to upload css and js files.

I've got CCK filefield up and running, and it works with css files, but it refuses to upload .js files. It instead seems to view every .js as ".js.txt" and then the file appears on the server as thisismyfile.js.txt

Not ideal...

Does anyone know how to work around this. Is it a mime type problem with Drupal or the server, or is Drupal set up to avoid script uploads and n00b hack attacks.

Once the files are uploaded I intend to use PHP mode on the page or node to call drupal_add_css and drupal_add_js.

© Stack Overflow or respective owner

Related posts about drupal-6

Related posts about drupal