InMotion Hosting Support Center

upload doc with .js extension

Category: Billing

2013-11-28 4:14 pm EST

Hits: 1,261
Uploaded javascript document--both through Filezilla and through Notepad++--it shows as text/x-generic type in my fie manager. Before uploading it was fine, with javascript icon and the .js extension. It still has .js extension--but shows as plain text file. Help! How can I upload a javascript file --or turn a text file into a javascript file in file manager? Thanks.

You must login before you can ask a follow up question.

You must login before you can submit an answer.



9,968 Points
2013-11-29 2:04 pm EST
Hello Isaine, and thanks for your question.

It would appear that the cPanel File Manager doesn't display the appropriate MIME type for JavaScript files with the .js extension. However, if you view the same file on the server-side via your FTP client like FileZilla, it looks like it is recognizing it correctly.

You can also test it in your web-browser, for instance with Google Chrome if I load up a JavaScript file from my website. I can then hit F12 to bring up the Developer Tools and navigate to the Network tab, I can clearly see that it's coming into my web-browser as a text/javascript type.

If you are not seeing this behavior, I have seen around the web from some searching on the matter that some people fixed corruption issues by saving their JavaScript files in UTF-8 format prior to uploading.

I don't actually see any .js extension files on your account at the moment. So if you're still having issues please leave it on the server so we can inspect it to see what might possibly be the issue.

- Jacob

You must login before you can post a comment about this answer.

Thank you very much. Please see the email I sent to Brad Markle <> on December 6. There is now a .js extension file on my account. I sent a screen print from Notepad++ and from my cpanel account. Waiting to move forward....
8 Points
2013-12-11 3:00 pm EST
Hello again Isaine, sorry for the delayed response.

I unfortunately did not see the email you were talking about. I did go ahead and take a look on your account and saw the JavaScript file you were more than likely talking about.

Here you can see that when I'm looking at the JavaScript file in cPanel's File Manager it is showing as text/x-generic. However when I'm actually looking at it from my web-browser, you can see that Google Chrome is showing this file as a application/javascript file and that should be what matters.

javascript file showing as text generic in file manager

Taking a look at the JavaScript code in your script, and the HTML file that you have that's using that script, it looks like it's properly running the JavaScript code and replacing the content of the HTML page.

Are you having any specific issues with the JavaScript code working, other than it just showing as text in the File Manager?

- Jacob
9,968 Points
2013-12-13 5:36 pm EST
Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

Social Login Joomla

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!