[Project_owners] web server MIME-types for XPI?

Eric Jung grimholtz at yahoo.com
Mon Jun 27 05:50:22 EDT 2005


Thanks, everyone. I went with Michael Johnston's approach since it
seemed the simplest and is cross-platform.


--- Michael Vincent van Rantwijk <mv_van_rantwijk at SPAMFREEyahoo.com>
wrote:

> Didier Ernotte wrote:
> > The server should set up the mime type to
> "application/x-xpinstall". If
> > it's an apache server, maybe the mine.type file does not contain
> a line
> > for xpi file. 
> 
> > I have the same problem with my remote server. I have
> > tried to put "  type='application/x-xpinstall' " in the href of
> the
> > link , be it seems that the default mime type of the server has a
> > higher priority than my html setting. You can also use a
> firefox-only
> > javascript method to load it (I don't remember its name,
> something like
> > InstallPackage...), but it's not cross-plateform.
> > 
> > Didier 
> 
> Can you use PHP on that server? If yes, this should work:
> 
> install.php
> 
> <?php
> 
> $completeFilePath = substr($_SERVER['PATH_INFO'], 1);
> 
> if ( stristr($completeFilePath, 'tp://') ) {
>    $fileName = basename($completeFilePath);
> 
>    header('Cache-Control: no-cache, must-revalidate');
>    header('Pragma: no-cache');
>    header("Content-type:
> application/x-xpinstall\nContent-Disposition: 
> inline; filename=\"".$fileName."\"");
> 
>    $fd=fopen($completeFilePath,'r');
>    fpassthru($fd);
> } else {
>    header('Location: /');
> }
> 
> ?>
> 
> Initiate the install with:
> http://foo.bar.com/install.php/http://foo.bar.com/myxpi.xpi
> from you (X)HTML source.
> 
> Michael
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Project_owners mailing list