My Firefox extension not loading on browser - php

My Firefox extension not loading on browser.
I uploaded it my server but when i clicking that link , it's not loading my browser. I have been seen just content codes.
How can i change content type as application/x-xpinstall ?
http://www.alisverisbook.com/zamantunelikaldirma/install.php?type=firefox
images:

Output a Content-type header in "install.php" prior to reading the file contents to the browser.
header("Content-type: application/x-xpinstall");

Related

Can't download JPG file on Chrome using <a> tag and Base64

Is it a well known issue that JPG files can't be downloaded in Google Chrome via a download link using base64?
On other browsers the JPG file downloads as it should.
I tested it with all other kinds of files on Chrome (txt, png, pdf). These all work. I cleared my Chrome cache, disabled antivirus, disabled all extensions, disabled firewall. None of this made a difference.
This is a screenshot of what I get when I try to download the file. Translation of the error message: "Download
Failed - Network error".
Try Like This
Source : W3schools
<a> download attribute:
If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the HTTP header give priority over this attribute.
If this attribute is present and Content-Disposition: is set to inline, Firefox gives priority to Content-Disposition, like for the filename case, but Chrome gives priority to the download attribute.
<!DOCTYPE html>
<html>
<body>
<p>Click on the w3schools logo to download the image:<p>
<a href="/images/myw3schoolsimage.jpg" download="w3logo">
<img src="/images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
</a>
<p>Notice that the filename of the downloaded file will be saved as "w3logo.jpg" instead of "myw3schoolsimage.jpg".</p>
<p><b>Note:</b> The download attribute is not supported in Edge version 12, IE, Safari 10 (and earlier), or Opera version 12 (and earlier).</p>
</body>
</html>
Chrome can't download a file bigger then 2MB. Firefox has set this limit to 5Gb I believe.

PHP generate file, download and unlink in mozilla doesnt work

I have problem with mozilla firefox in this case. I am generating file on the fly and then trying to download the file and then delete it from the server. Problem is, Firefox says the file doesnt exists, even though I can see it is generated on the server. Chrome and Opera works perfectly.
firefox version: 58.0.2
Any ides what has to be tuned for firefox ?
header('location: /path/'.$name.'.pptx');
header('Content-Disposition: attachment; filename="' .basename($name).'.pptx"');
ob_start();
flush();
sleep(5);
unlink($name.'.pptx');
First of all, just for sanity, please use Location instead of location.
Also, as per my understanding, once you send the Location header, the browser does a redirect to the specified URL. When the browser has redirected to a different page, I feel all the headers post Location shall be rendered useless. The URL from which you are downloading should send the Content-Disposition header. Also, I would suggest adding the headers Content-Type and Content-Length on the download URL.

Empty lightbox when pdf confugered save file in firefox

I am using joomla 2.5 with ROXBOX plugin and using this showing the PDF's in lightbox. I am facing problem when user configured Firefox auto download PDF files.
When Firefox configured as save PDF instead of open it in browser the light box stays blank and file started download. As we can not have control on browser, is there any way show any message when Firefox auto download for PDF is enabled?
Please Help!!
I assume you want the PDF to display in the browser, rather than forcing a download. If that is the case, try setting the Content-Disposition header with a value of inline. and 'Content-type to application/pdf.
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="the.pdf"');
You can use PHP to set header as shown above.

Android browsers wont open PDF in Browser when Content-Disposition is set in Header

On my Apache webserver i can server PDF files directly in the Browser with a simple Anchor link like:
Click to display PDF
This Works fine.
Now, i've got a lot of PDF's i want to Protect. So i moved them all outside the Web folder, and are serving them through a PHP download program - i called it download.php
To be sure that the pdf files are not downloaded as "download.php" i have to set the Content-Disposition Header to 'inline;filename="mysample.pdf"'. Inline because i want to open it in the Browser.
No Problem, all works fine. the files are downloading fine on Windows and Apple Browsers and are displayed IN the Browser, just like when its served directly from the Apache Server.
But my download.php doesn't work with Android Browsers... It's always just downloaded but not opened in the browser. You have to find the file in your messages and open it separately. When served directly from Apache it IS opened in the Browser.
It seems to be connected with Content-Disposition Header im setting in my download.php, because this is the only difference i see in the headers when download direct and indirect.
Anybody had the same problem?
Thanks
Per

Problem Viewing PDF in Browser

I have a link in my page :
View PDF
The problem is that when the link is clicked, Instead of viewing the content of the file in the browser, the file is downloaded .
Any ideas what's wrong?
ps : I have Mozilla FireFox 3.6 & Adobe Reader Installed
Make sure you use the correct mime type (application/pdf), and the Content-Disposition: inline header.
Check your webserver is providing the correct MIME type for the response - it should be application/pdf

Categories