I have a simple html page to open a different HTML based on a OPTION list using an ON CHANGE to fire the WINDOW.OPEN,
In IE8, I get a window appear and disappear real fast when I select May10.
when I select SFAA or google, it works fine and opening the xls file using A HREF works fine too.
I try this in Firefox(3.6.13), chrome and everything works fine.
`<select name="target"
onChange="if (this.options[this.selectedIndex].value != '')
{window.open(this.options[this.selectedIndex].value,'_blank');};" >
<option VALUE="" style="color:#000000;">Select</option>
<option VALUE="http://www.google.com">google</option>
<option VALUE="../May10.xls">May 10</option>
<option value="../sfaa.pdf">SFAA</option>
</select>`
window.open(this.options[this.selectedIndex].value,'_blank'); does not work in IE8. '_parent' or '_self' works in IE8 too.
everything works fine in Firefox and google chrome
I came across a solution on web, replace js call
window.open(this.options[this.selectedIndex].value,'_blank');
with
var w = window.open(this.options[this.selectedIndex].value,'_blank');w.location.href = this.options[this.selectedIndex].value;
It woks fine in both IE8 and firefox.
Can you maybe post a screenshot or description of the window or info message that appears?
...cause it works fine for me when I tried on IE8/Windows 7/MBP.
What I did is I made an html file of your code you posted and when I selected my own xls file (saved in Excel 2007) in IE8, it prompted me with the dialog to open/save/cancel the file (like when you download an attachment) and I can select to view it, and the document opens up successfully.
Maybe also check the relative path you've supplied whether it is right that the named file exists and is not corrupted and your computer is programmed to run xls files with Excel by default?
What headers do you see on the HTTP response for the XLS file (e.g. look in Fiddler)?
If it cannot be downloaded (e.g. due to no-cache headers) then you might see bad behavior like this.
http://blogs.msdn.com/b/ieinternals/archive/2009/10/03/internet-explorer-cannot-download-over-https-when-no-cache.aspx
Related
I would like to know how to use in bash in order to first chose some parameters on a internet page then upload a *.txt file, and be redirected(after file analysis) to an other page and finally to press on a button to download a new file all this in bash.
I found a lot of information on forums regarding cURL and how to fill in forms and download files but very often you could juste download the file by accessing with URL/file.txt. Here it seems to me that it is different because the page uses some code in order to analyse my .txt file and output a new one.
The site is MSC server and I need to check the CADD checkbox in option 2, upload a *.txt by choosing file, click on upload & submit and after beeing redirected click on download result. Here is the html important parts
first page:
<form action="UploadServlet" method="post" enctype="multipart/form-data">
Apply MSC to: <input TYPE=checkbox name=measure1 VALUE=CADD> CADD 1.3
<input type="file" name="fname" id="fileChooser" size="16" /><br>
<input type="submit" value="Upload & Submit" size="20" onclick="document.getElementById('pleaseWait2').style.display = 'block';"/>
second page:
<form action="DownloadServlet" method="post">
<input type="submit" value="Download Result" color ="#ff0000" size = 200>
That is what I tried
curl -L -F measure1=CADD -F fname=#file2.txt -F submit="Upload & Submit" http://pec630.rockefeller.edu/MSC/
That was what I tried for the first page but it only shows me on the terminal the HTML code of the same page not the one where I should be redirected. And even if it gives me teh HTML of the second page, I've got no idea on how to download the file, firstly because the URL changes so I don't know what to put for the URL (I think it's something with cookies but I'm not sure) and secondly even when I try to click on a button and to download a file (for example, ont the example button on the first page, it still shows me the HTML code and it doesn't download the text file).
I hope I was clear enough and that you will be able to help me, I'm still a beginner in programmation and It's been 10 hours since I started to find how to do this:/.
Also since it's my first question (I normally always find previous questions that were like mine) I take this opportunity to thank you are all because your answers are always very clear, and I hope I'll be able to help other people to when I'll understand more of what I do :)
I didn't found the kind code I was looking for (I suppose it is a problem with cookies but even when I tried to handle them with cURL it is not working) but I found a way to get around "any" (I think) cURl problems. Maybe it will help others:
Just copy the headers your computer sends to the site as you a doing what you want:
in google chrome
view -> developer -> developer tools -> do what you want to -> right click on the name which pops up in the side bar -> copy as cURL -> paste it in your code
It's certainly not the best way to do it but if you're desperate as I was it works:)
I am creating a pdf document (via ColdFusion), but when I preview the rendered pdf in Firefox, I get the number "4" where my checkmarks are supposed to be (see photo below). When I preview the exact same pdf in Chrome or IE, I see the checkmark, and it all works perfectly!
I am pre-populating the pdf form fields (via ColdFusion session variables), and then rendering the pdf using the following markup:
<cfpdfform source="82040.pdf" action="populate">
<cfpdfformparam name="org" value="">
</cfpdfform>
Here is the resulting pdf form in Internet Explorer:
Note how the checkmark is rendered properly:
Here is the same form previewed in FireFox:
Note how the the checkbox has a "4" instead of a checkmark:
Any help would be greatly appreciated!
It is a bug with Firefox's PDF Viewer. Currently, there is no fix. As radiovisual's post points out, the bug in the underlying library (pdf.js) was supposedly fixed. However, there is still the issue of Mozilla updating the older version baked into Firefox (which is what most folks are using). Currently, that bug is still outstanding.
Probably the best you can do is to return the pdf as an "attachment", rather than "inline", so the browser prompts them to "open/save" the file. If the user opts to "open" the pdf, it should open with their default program instead. (Adobe Reader is the default for most users).
<cfheader name="Content-Disposition" value="attachment; filename=fileName.pdf">
<cfcontent type="application/pdf" .../>
Update:
This bug was apparently addressed already, as pointed out via the project's github repo: the bug was supposedly fixed during this commit. So if you are still experiencing problems, it either means:
You are using an outdated version of the pdf.js library,
Or, the problem has been re-introduced into the library.
So to start things off, you will want to make sure that you are using the most up-to-date version of the pdf.js library. If you are still experiencing problems, even with the most up-to-date version, then the problem is still within the embedded pdf document viewer, and there aren't too many things you can do to fix this until the project maintainer's finally fix the problem.
The issue you are experiencing (the reason why you are seeing a "4" where there should be a checkmark, is because the pdf.js library is using a special symbol font to render the checkmarks, but in problematic versions of firefox's embedded pdf-viewer the symbol font isn't rendering the checkmark correctly, so it shows a "4" instead of a checkmark -- because the checkmark symbol they are using in the custom font just so happens to be mapped to the number "4".
Similarly, for the same reasons cited above, if you assign the checkbox to render squares (instead of checks), the letter "N" will appear in the checkbox instead of a square, because the square shape symbol is mapped to the letter "N".
This problem only exists in the embedded pdf document viewer in Firefox but will look perfectly normal when viewed in Adobe Acrobat Reader, or other offline pdf readers (and other browser pdf readers, which is why it looks fine in Chrome and IE), so when users download the form, it will appear like you would expect it to.
Some workarounds / optimizations you could try:
Try one of these, or all of these, they are in no particular order (or guaranteed to work)
Don't rely on the built-in pdf.js browser extension in firefox, instead, make your own updated version based on the latest pdf.js source or target another pdf library and use it's browser-agnostic API to render and display your pdfs.
Create an HTML form for the user to fill and verify all the information, then render the pdf based on the data supplied by the HTML form, for download only (no previewing in the browser). This will force them to open the pdf in their default pdf viewer where the issue is not present, because, again, the problem you describe only happens in Firefox's embedded pdf viewer and not in other pdf viewers like Adobe Acrobat).
Make sure you have the ZapfDingBats Font installed on your server. I haven't confirmed this, but that commit that was supposed to have solved this issue seems to have added support for this font, so it is worth a try to make sure this font is accessible on your ColdFusion server, then try previewing the rendered pdf in Firefox.
Detect that the user is accessing your form via Firefox, and if so, warn the users of the issue, but assure them that downloading the form and viewing in their default pdf viewer will work as expected.
Convert the page to HTML5 (if you aren't already), then add in an HTML5 shiv (so HTML5 features can be used on older browsers), and a CSS normalizer, and test if the problem persists using these optimal settings. It's worth a shot to make sure that the problem is somehow treated differently under the HTML5 standard, since not everyone is having the same issues as you.
Lastly, make sure that your HTML is being rendered as valid markup via your ColdFusion output by using an HTML validator.
Other than that, there isn't a whole lot you can do until the mozilla team updates their embedded pdf viewer. But since the problem is only in the firefox viewer, and not in the pdf itself, it it up to you to decide if this is a deal-breaker or not, and search for alternatives.
Note: PDF.js is built into version 19+ of Firefox.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update: You can use this pdf (which represents the character mapping of the ZapDingbats symbol font) as a way of testing your browser's interpretation of embedded fonts in the pdf rendered via pdf.js. Note that at the time of this writing, the above pdf does not display the Zapf Dingbats properly in Firefox (via pdf.js), but other browsers render them just fine (notice the "4" next to a20[x2714] in firefox, and the checkmark next to the same entry (a20[x2714]) in Chrome.
I want to load a pdf file located in upload/grilles/ where upload is located in the root.
My code:
<?php echo $nomFichier; ?>
When I click in the link, codeigniter doesn't want to display the document unlike in a site without framework that display.
Why?
Thanks !
This is not a codeigniter problem, but a browser (Firefox) issue.
I'd recommend the PDF.JS library, which is a general-purpose, web standards-based platform for parsing and rendering PDFs.
note: your above example behave (checked on localhost ) in other browsers than FireFox as follows:
Chrome Version 34.0.1847.137: shows pdf in new window right away
IE 11: asks for permission to show the pdf, if granted shows pdf in new window right away
Safari (for windows) 5.1.7.: shows pdf in new window right away
Opera 12.11: shows pdf in new window right away
So....
It's just my URL.
The file name contains a space, but I injected the name in the url which gave:
localhost/xxxx/yyy/file%20test.pdf
but the url's file is:
localhost/xxxx/yyy/file_test.pdf
Sorry for the inconvenience
I've got a bit tricky problem... I've got this file upload control which is only used for uploading profile images. When it is clicked it opens a Windows explorer Browse window. I would like this window to have the filter preselected on image files (.jpg, .png, etc.) and mine only has "All Files". This is what I'm talkin about:
I would also like to set a default location for the folder. Is there any way to set this Browse window?
You could achieve that if your browser supports HTML5 by adding the accept tag to your file input:
<input type="file" name="file" accept="image/jpg, image/gif" />
If your browser doesn't support HTML5 you are pretty much busted. Prefiltering file input dialogs in legacy browsers to a certain file type simply is not supported. You will have to use Flash or some equivalent client side scripting technology. You might take a look at some file upload controls such as Plupload, BlueImp and Uploadify which are abstracting much of this hassle for you.
I need to open a csv file within firefox. By default, it asks me to choose a download location or to open it with an external program. However, regarding the context, I have to display it straight away inside the browser as plain text, without passing by the popup screen which asks me what to do with the file.
I tried to tweak the Firefox "mimetype.rdf" in order to force the content type "text/csv" to be opened in browser. However, I don't find much information about this file, so I was more or less guessing... This is what I came out with:
<RDF:Description RDF:about="urn:mimetype:text/csv"
NC:value="text/csv"
NC:editable="false"
NC:description="CSV page"
NC:fileExtensions="csv">
<NC:handlerProp RDF:resource="urn:mimetype:handler:text/plain"/>
</RDF:Description>
My idea was to force firefox to treat text/csv as text/plain. This code does not work. But anyway, I managed to force content type using "Mason" firefox extension. However, when the browser sees it as a text/plain, it propose me to open it with notepad or download, does not help me much.
I tried other content types, the text/html, text/xml, it always asks me to choose an external application or download.
I tried to use several extensions, "openInBrowser" and "ViewAsText" make me able to do what I want, but I have to explicitely go in a menu and click the "view as text in the browser", no possibility to set a behavior for the content type "text/csv".
How can I explain that I want all the "text/csv" to be opened inside firefox by default?
Any idea?
Thanks
You could have an upload field where the CSV file gets uploaded to the server. Using server-side code (ASPX for example) you could upload the file, then read the contents of the CSV file and display the results using a Response.Write to the browser.