How can I preset a filename for saving a html page? - html

I have a webpage like e.g. www.example.com/NYSE/rates. If the user decides to save the html she sees on her local disk, I want to preset the filename she gets, when she clicks "Save as", with NYSE_rates_09_12_2011.html. (Which obviously will be different tomorrow or for a different stock exchange.) Now I always get rates.html as default.
How can I do that?

It appears that in at least the latest version of the most popular web browsers on Windows (Internet Explorer, Firefox, Chrome, Safari and Opera) the default filename filled in when saving a webpage is taken from the page's <title> tag, so simply making sure the date appears in there should put you right.

As I found out, this is a known problem with Firefox, that stems from the days of Netscape Navigator. And there is an add-on "File Title" that fixes it.

Related

How to open a local HTML file in Safari on an iPad

I'm teaching a Year7 class via Zoom on writing HTML, and I have one student on an iPad (the rest are on desktops/laptops), and they're not able to get their webpage to open in Safari (I'm using Chrome on Windows, which of course is simply a matter of double-clicking on the file). I'm trying to see what she sees, but I think Zoom is possibly not showing me the pop-up dialogues. She is using Notes to write the page (which looked to be the closest iOS equivalent to Notepad).
I Googled and sent her a few blogs, but still not working. I said she needs to click on Share and look for something like "copy path to file" or "copy link", and then paste that into the Safari address bar. She said when she did that Safari was showing the source code, not the rendered page. When she just taps the file it opens in Notes, not Safari. That made me suspect her file was actually index.html.txt (she tells me she has extensions switched on), but when I sent her my own file, which is definitely only index.html, she says the same thing is happenning.
Is anyone able to give me some definite step-by-step instructions (this is for a Year 7 student) on how to open their local HTML page in Safari?
thanks,
Donald.
Safari iPad no longer supports access to local or iCloud files. A number of iPadOS apps will however allow a user to view, edit, and test html code in files stored in local iPad, iCloud, or third party (e.g. Google or Dropbox) storage folders. One needs only to search in the App Store for “html editor” to see the list. Some of the apps have features that rival or exceed those found in tools on desktop (laptop) systems.
I had the same issue today on ios15.
There is a free app called Koder available on the App Store which will let you edit and view the HTML file. I’m no expert but the editor looks pretty fully featured at first glance.
Sorry to say but an iPad is obviously not the best place for simple HTML editing. At least not with the default apps available on iOS.
Given an existing HTML File one can use Files app to navigate to it and open it with double click. This will open the file in a very simple viewer wich is at least able to render the HTML. As a developer i bet its using WKWebView which is basically Safari's HTML View.
Turns out Microsoft Edge, unlike Safari, can still open local html files. Discovered in this answer. To wit:
Install Microsoft Edge from the App Store
Open Files (or whatever file browsing app you like).
Open the file, then tap the Share button to send to another app.
Scroll across to "More...", choose Edge, and voila!

Links to PDF and other file formats generate "Page can not be displayed"

I just created this site and because I am using a Mac, I do not have IE. I have had a few people tell me that they are not able to download PDF files. That is to say, when they click on a link that is supposed to display a PDF file in a new tab, they get a "This page can not be displayed" error. I can take the same file and put it on a different website, create a link and it works fine in IE.
The link to this page is www.dallascameraclub.org. Try clicking on any Newsletter as they are all PDF's. They will produce an error in IE. Works fine in Safari, Firefox, and Chrome.
This is a wordpress site and I have never heard nor had this problem before. I have no idea why this would be the case.
Research seems to always blame IE for something or another but there are several people complaining of this when this issue never happened on the older site. Same links, same PDF's and other document types. I am a bit perplexed.
Any ideas?
Many thanks,
Houston

Chrome downloads PNG image links. I want them to open for viewing in a new tab. How do I make Chrome do that?

When I click on an image link right now, Chrome downloads the image instead of opening it.
Even if I right-click and select Open link in new tab Chrome still downloads the image, and I have to go through the extra steps of opening the file for viewing manually.
This feels like a mime-type issue to me, but why would Chrome not recognize "image/png" as a valid mime-type for viewing? All PNG images display just fine in an HTML page.
NOTE: This only happens for PNG images.
The web server is probably serving the image using the image/x-png MIME type. Chrome does not recognise this as an image (as of August 2012 February 2013), hence offers the file as a download.
image/x-png is a legacy MIME type from the days before it got its official name, image/png, in 1996. However, when Internet Explorer uploads an image it does so using image/x-png "for backward compatibility". I believe this was the case up to IE8, and was "fixed" in IE9. If the web server does not correctly handle this (the web server should detect this non-standard MIME type and treat it as image/png), then it may serve up the client-provided MIME type to other users, including to Google Chrome. Additionally, some web sites will serve up all PNGs as image/x-png.
If you're the web developer you should detect incoming image/x-png and treat it as image-png (never serve up image/x-png).
If you're the user report it as a bug and see #kriegaex's answer for a workaround.
#Tom Clift is right, and here is my workaround for it: use Chrome extension Redirector and add a rule replacing the Content-Type header. That's it. :-)
You can use the Chrome extension Undisposition to achieve this.
When you right click on the image you need to select then 'Open image in new Tab' from the drop down and NOT 'Open link in new tab' this will then open the image in a new tab.

.png images display in IE8 alone but not inside a page

It's been a while since I did serious web development. Now I meet a host of brand new problems I'm no longer familiar with..
I have some .png images for various icons in my web page. What I find is that whenever I edit these images, they stop working inside a page in IE8. That is, they (usually) display OK when I first open the page, then are replaced by the placeholder icon on refresh. Sometimes, some of the icons display and others, with the same src, don't.
My image tags are nothing fancy, typically:
<img src="images/misc/smallreport.png" alt="Report" />
When I right-click an icon in the page and select "properties", protocol, type, address and size are shown as "Not Available", and dimensions are incorrect (size of the placeholder, I bet).
If I open the images directly in IE (ie. not within the page), they work just fine.
I have used Paint.NET to edit the images, but have also tried saving them with Paint.
Right now, I am working right off the hard disk (ie. not through a web server). And, oh yes, none of this happens in Google Chrome.
What's going on here?
check the path to the file is correct - can we see the tag please.
Well, we learn something new every day..
I mentioned that I'm running this directly off the harddisk? Now, it turns out the html page (which I had gotten off a coworker) was blocked "to help protect my computer", as Windows does.
This is no big surprise, lots of files I'm working with originate on other computers, and I usually don't worry much about it (except with executables, which won't run until unblocked).
It seems, however, that when IE8 loads such a blocked HTML file, its security settings adjust somehow, and - well, I can only guess at the details, but as soon as I right-clicked the HTML file, selected Properties and clicked the "unblock" button, the problem went away.
Something similar happened to me once, I tried hard to find what was wrong, then I realized I was saving (from Photoshop) the file as PSD but with extension .png. Make sure you're not doing the same.
Also:
Clear temporary Internet files
Verify that the Show Pictures option has not been turned off
Make sure that the Toggle Images.exe Web accessory is not present and disabling images
Make sure that a third-party Internet security, firewall, or cookie-blocking program is not causing the problem
Enable the Auto-Select encoding option
Source
It might be that the website you have browse has a lack of support
for an IE browser. IE is a nightmare for all web developers & Web designers.
It might be the developer of that website didn't care for an IE display because
of IE issues. Perhaps IE is trying to create a web standard to increase their
sales and marketing strategy. That's why don't care the modern Web development standard.
Why Chrome or Firefox or Safari, it's a free anyway.

Force links in lotus notes emails to always open in a new window?

I'm using C# to generate emails that are read using Lotus notes. The problem is we want the links to always open up in a new window in IE but they always open in the same window when I use "Lotus Notes - Basic Edition" (8.0.1) but when I use the regular lotus notes 8.0.1, they always open up in a new window. I tried looking around in the preferences but can't find a setting that'll explain this.
(note: I'm using IE 8 as my default browser. If I change it to chrome or FF this doesn't happen)
Not sure you are still facing this problem or not, but for the sake of other users posting the solutions.
In Location Preferences, under Internet Browser, don't select "Microsoft Internet Explorer", instead select others and then browse to path of Internet Explorer -
"C:\Program Files\Internet Explorer\IEXPLORE.EXE"
Save it. Now your links will always open in different IE window.
When you generate the emails, are you able to enter HTML code for the links? If so, perhaps you just need to add a target="_blank" attribute?
The preferences for which browser to use in Lotus Notes are set on the client's location document, so I'm not sure if that's part of the issue your having?
This sounds more like an admin question, but the link will get opened based on the preferences in the individual client. In 8 basic the location document controls this. Edit the current location document and go to the Internet Browser tab. You can then choose which browser to use. It sounds like you have it set to use IE inside notes, rather than separately.
The fact you can open links properly with Firefox, Chrome means the issue is not with Lotus Notes.
I have seen issues where IE wasn't working with _Blank. Switching off UAE resolved the issue.