SandySynaptik Posted September 10, 2011 Share Posted September 10, 2011 How to include the content type, where?Its making problem in downloading file. Actually I am hosting a chromium app on my server, And when I click on Install Now(the link), then it gives the following error: Apps must be served with content type application/x-chrome-extension. I have the following source in the file: <html><head><title> Click on install now. </title></head><body><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top"> <br/><br/><br/><br/> <br/><br/><br/><br/> <br/><br/><br/><br/><a href="/chromium/apps/install.crx" class="button">Install Now</a></td> </tr></table> </body></html> Link to comment Share on other sites More sharing options...
Don E Posted September 10, 2011 Share Posted September 10, 2011 Check out this link: http://code.google.com/chrome/extensions/hosting.html Try putting this in the head of the document:<meta http-equiv="content-type" content="application/x-chrome-extension" /> A !doctype declaration would also be a good idea at the very top of the page. Link to comment Share on other sites More sharing options...
SandySynaptik Posted September 10, 2011 Author Share Posted September 10, 2011 I already checked that website before posting here else I would have posted this question in extension development group, this is case of HTML. Now go to the page itself and see what mistake I did:http://fbupload.webs.com/chromium/apps/crossword.html Link to comment Share on other sites More sharing options...
Don E Posted September 10, 2011 Share Posted September 10, 2011 I noticed you forgot to add the closing bracket to the class .button. Also there's an extra closing bracket at the end of the closing style tag: <style type="text/css">.button {line-height: 1;text-decoration: none;display: inline-block;padding: 8px 12px;font-family: Arial, sans-serif;font-size: 22px;letter-spacing: 1px;color: #fff;cursor: pointer;-moz-border-radius: 5px;-webkit-border-radius: 5px;-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.40);-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.40);text-shadow: -1px -1px 0px rgba(0,0,0,0.15);background: #76bbc5 url('../images/overlay.png') left top repeat-x; /* fallback color + image */background-image: -moz-linear-gradient(100% 100% 90deg, #76bbc5, #9ecbd1);background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#9ecbd1), to(#76bbc5));.button:hover {opacity:0.9;}/*COLOR VARIANTS*//* Just add the class green to your button to change the colors */.green { background: #9dc773 url('../images/overlay.png') left top repeat-x; /* fallback color + image */ background-image: -moz-linear-gradient(100% 100% 90deg, #9dc773, #afd18c); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#afd18c), to(#9dc773));}}</style> Should look like this: <style type="text/css">.button {line-height: 1;text-decoration: none;display: inline-block;padding: 8px 12px;font-family: Arial, sans-serif;font-size: 22px;letter-spacing: 1px;color: #fff;cursor: pointer;-moz-border-radius: 5px;-webkit-border-radius: 5px;-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.40);-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.40);text-shadow: -1px -1px 0px rgba(0,0,0,0.15);background: #76bbc5 url('../images/overlay.png') left top repeat-x; /* fallback color + image */background-image: -moz-linear-gradient(100% 100% 90deg, #76bbc5, #9ecbd1);background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#9ecbd1), to(#76bbc5));}.button:hover {opacity:0.9;}/*COLOR VARIANTS*//* Just add the class green to your button to change the colors */.green { background: #9dc773 url('../images/overlay.png') left top repeat-x; /* fallback color + image */ background-image: -moz-linear-gradient(100% 100% 90deg, #9dc773, #afd18c); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#afd18c), to(#9dc773));}</style> I clicked on the 'install now' button and I am prompted to download, getting no errors. Link to comment Share on other sites More sharing options...
SandySynaptik Posted September 11, 2011 Author Share Posted September 11, 2011 Oh! Thanks for pointing out that mistake, I have corrected that. :)But this doesn't solves the problem . Go ahead and try to install that app, don't worry I have specially made that app for this topic and contains nothing than a sample page. I still get and error of content type. Link to comment Share on other sites More sharing options...
Don E Posted September 11, 2011 Share Posted September 11, 2011 It looks like you have to configure the server the demo.crx file is on to make this work. Go to this link: http://stackoverflow.com/questions/5367746/problem-with-self-hosted-chrome-web-app "You need to tune your web server accordingly to send required headers." There's also a suggestion there to download the file by right clicking and saving it somewhere, and then drag it into chrome, you'll then be asked to install it, choose continue(at the bottom), and install sample app will show up asking you to install the app. If you want to do the above, you'll then have to let your users know how to do that though. Link to comment Share on other sites More sharing options...
Synook Posted September 12, 2011 Share Posted September 12, 2011 If your server runs Apache, you can use mod_mime to set the content-type for the .crx extension. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.