Register custom URI scheme for href in epub XHTML - xhtml

I'm developing an epub file and checking it with epubcheck. I'm getting this warning:
Non-registered URI scheme type found in href.
Epub files contain XHTML content documents which can have <a> tags pointing out to remote resources. In this case, the href attribute contains a URI whose protocol is bitcoin:.
Question: How can I register the bitcoin: protocol scheme for href attributes in my epub's XHTML so that epubcheck no longer reports a warning?

EPUB viewers do not understand the bitcoin scheme, since they do not include the logic to participate in a blockchain.
Nothing you declare in your EPUB file is going to provide that capability to the viewer. If it were possible to do so, that would effectively become a remote code execution vulnerability.
Your EPUB file should instead link to a resource that can handle the bitcoin scheme, such as a web app that can perform blockchain operations.

Related

How do I download an aspnetForm page with links

I'm trying to download a municipal planning plan together with all the relevant documents.
All documents can be reached from the following link
I've tried the following command (that worked well for other sites) and some variations without success.
wget -E -k -r -l 3 "http://www.mavat.moin.gov.il/MavatPS/Forms/SV4.aspx?tid=4&et=1&mp_id=ppnCWTcsST9gG0%2fa0ayWnjFyZ%2bo14s221Ujlpi7UvR4jIRAHLKhJ8lOLSkomZ%2fvlHk8b2T0oENpI6Wh2hKzxQJCw9BPJP8gav%2ftgiKlk5S0%3d"
The same plan in their new site I can't get the files either,
https://mavat.iplan.gov.il/SV4/1/5000931297/310
I'd appreciate any help.
Well, these days, and especially with .net web sites?
We don't use hyper-links with a simple (full) path name to actual files from the web server. In fact in most cases one will not even give the web server rights to those folders. (they are not exposed to Internet Services).
So, no actual links as a full "url" to documents exist.
What happens is when you click on a button or button link? Then the code behind on the web server runs. (and that is code you don't have). And further more, that code behind can browser, read, retrieve any file from any folder on the server or other servers. But links from the web site don't exist and it not even possible to type in a url to resolve to a actual file name on the server.
So the server side code (not internet services) goes and grabs the document. In fact, the documents could be in a database. So, the code behind on the server side runs and pulls the binary data from the database (which represents a valid PDF file). Or the code behind reads the file from disk and then STREAMS the file for a download.
Now, this is often done for reasons of security. It means that no valid URL exists to get at a document.
Not only is this done for security, but from a developer point of view, it often better to retrieve a row from a database. That row can have the information you SEE rendered on that form, but the web page is not static, and the display of information is thus a developer coding a pull of rows from a database, and then you simply "assign" that data to some type of control - save datagrid, or listview or whatever. (this assignment of data is only 1 or two lines of code, and then the control + web server renders that datagrid control.
So, this is done since the developer thus only assigns the result of a database query to the control when then renders on the form. Thus, to add or remove documents? Then you only have to edit the database for the information on the web page to render.
As a result? There is no direct links to the actual documents on the server. To retrieve a document, you would have to send to the web site the exact command required.
You can hit f12 (most browsers support this). This will put your browser into developer mode. If we do this, and then select elements (select element feature). Now click on a pdf link. You get this:
<img src="../images/ft/file_PDF.gif" style="cursor:pointer"
onclick="openDoc('99000526871729',
'AABA7BE646E182B67DB1C15220E531DF36BBB591D8EEA7757435B2606C08E6F9')">
So, note above. The above code event openDoc is the SERVER side code you have to run to retrive a document. There is thus NO link. And you not going to be able to wire up, or run your OWN web page that hits that server and runs the routine "onclick".
However, the onclick DOES expose the internal database document numbers used to pull/read and retrieve a given document. But the path name, and how the code gets/grabs this file? You have no idea, and HAVE to run server side code (c#, or vb.net) code. That code as noted grabs the file and then uses code to "stream" the file when you download or click on a link.
So for simple HTML like pages? Well, for those that took a one day HTML course? Sure, such web sites will have scr=some path name to a valid url). And these simple systems thus allow you to enter a URL to grab/get a document. And those documents are fully exposed to the web site, and a simple valid URL path name to a file exists. Not so with asp.net, and as noted, this is not only done for security, but it a better over all developer experience to write code that grabs the files as opposed to rendering full path link names to files.
There are many additional benefits. For example, the database that drives this likely has a setting (or some settings) that contain the path names to the documents. If they run out of storage, or say want to move older files to a much slower storage system, which of course is much lower cost? Then can move the files, and update the path name columns in the database. The web site will continue to work, since we NEVER using a exposed URL on the web site. And as noted, actual direct URL's don't exist, and the web server (IIS) as opposed to the code behind will not even have rights to the file names.
As a result?
You not be able to simply pull the web page, and THEN extract the URL's to file names.
What you might be able to do is write code that loads the web page, and then scans all the event code stubs for the links, and have your code click on each button with web browser automation. But, even that don't allow you to enter file names into the download prompts.
So, what you ask is not easy, likely not possible, and a very difficult task. And the simple reason is that site does not use simple HTML and static links to files, and it never actually exposes a direct link to files, and even worse yet is the web server does not have or even allow a URL direct link to a site - they don't exist, and the web site will not even have rights or even allow such URL's to file names. (only the .net code behind does - not internet services).
and grabs the document and then code "streams" the file to to the web site or link you clicked on. So the simple HTML coders in the past would create say a folder (usually a virtual folder) that points to the files on some server/folder. But with .net, it easier (and far more secure).
Modern development tools don't use old fashioned ideas like a URL's to directly retrieve a file - they are designed differently.
In some cases, URL's are allowed or created, and this is done for reasons of sharing links. So if you have a cute video or document? Then the designers of the system will often permit use of parameters in the URL, so you can share a link to someone else. This page has no such provisions. So, you can share a link to the page, but no actual URL to documents or even provisions to allow URL's to a document even exists.
So this quite much means to retrieve a document, you have to go to that web page, and ONLY when you click on a document will the web site "stream" down that one particular document in question.

Drupal WYSIWYG strips file:/// protocol in CKEDITOR

Drupal HTML WYSIWY Filter strips "file:///" from hyperlinks even though I have allowed the HTML attribute a[*], what am I missing?
I want to open a local path \myserver\folder\file and thus I added the protocol in the link dialogue and can see in the plain text editor that the href is created properly:
test
but when I preview/save it that gets stripped and thus is not working
test
Filter Protocol module allows adding them, however, I discovered that the file URI scheme (file:\ protocol) to open remote server location is not supported on most browsers for security reasons Linking a UNC / Network drive on an html page
Unfortunately adding a browser extension isn't always a practical workaround.

Supporting AOL login with Google Identity Toolkit (xrds)

I'm working on getting Google Identity Toolkit set up, and according to the AOL instructions, you have to place a xrds document in the site's root to avoid warnings on the user's end. I'm a little confused as to how this works. Do I simply create xrds.xml with the relevant content and place it in the root directory, or does the file need to be referenced in the site's page headers as well? Is this still applicable to Identity Toolkit V3?
Google Identity Toolkit V3 is the recommended version and the XRDS file is needed as well.
The XRDS file could be of any name on your site, and your site could
return the file name through either
1) an HTML document with a element that includes a
element with http-equiv attribute, X-XRDS-Location,
or
2) HTTP response-headers that include an X-XRDS-Location response-header
An example of #2 is your server returns http response with header
X-XRDS-Location: https://your-web-site.com/yadis.html
where the content of the yadis.html looks like
<xrds:XRDS><XRD>
<Service>
<Type>http://specs.openid.net/auth/2.0/return_to</Type>
<URI>https://your-web-site.com/gitkit</URI>
</Service>
</XRD></xrds:XRDS>

What different customizations are possible by using HttpHandlers in an ASP.NET application?

Digging deeper into HttpHandlers I found they provide nice way to customize an ASP.NET application. I am new to ASP.NET and I want to know about different customizations that are possible using HttpHandlers. Lots of websites talk about how they are implemented but it would be nice to know some use cases beyond what ASP.NET already provides using HttpHandlers.
An ASPX page provides a base template (so to speak) for a form-based web page. By default, it outputs text/html and allows for easy adding of form elements and event handling for these elements.
In contrast, an HttpHandler is stripped to the bone. It is like a blank slate for HTTP requests. Therefore, an HttpHandler is good for many types of requests that do not necessarily require a web form. You could use an HttpHandler to output dynamic images, JSON, or many other MIME type results.
A couple examples:
1) You have a page which needs to make an AJAX call which will return a JSON response. An HttpHandler could be setup to handle this request and output the JSON.
2) You have a page which links to PDF documents that are stored as binary blobs in a database. An HttpHandler could be setup to handle this request and output the binary blob as a byte stream with a PDF MIME type for the content type.
Check this page for a good example and code of why you might want to customize them: http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx Essentially it can be used when you want to server certain files but not allow them to be accessible via a plain url (security).

how to open MS Office word in asp.net?

in my application, when user click on particular link button, MS word has to open how can i write the code for this. Thank you
There is no way to guarantee that a particular application will be opened when a user clicks a link / button on a web page. The application that is opened is determined by the user's browser and operating system settings.
As a developer you can specify the MIME type of the file that you are returning. By doing so you are telling the user's browser what file type is contained in the response. W3Schools provides a pretty good MIME type by content type list and FILExt also provides the MIME type for the files it lists.
Assuming you specify the appropriate MIME content-type you can be sure the user's browser and operating system will open the file in the "appropriate" application according to their settings. Since you want to open a Word Document file the appropriate MIME content-type will be one of the following:
Extension Type/sub-type
docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
doc application/msword
How and where you specify the content-type largely depends on the ASP.NET application type you are working with. If you are writing a ASP.NET Webforms application you'd change the MIME type of the Response object in the Page_Load method. In an ASP.NET MVC application you'd do so in a controller action. In either case the specific line of code is the same.
Response.ContentType = "application/msword";
When you click on a link, redirect the browser to the file mydoc.docx - the browser will open that in Word as long as they have Word installed. You will also need to maek sure your IIS server has the MIME type setup, see Downloading Docx from IE - Setting MIME Types in IIS
If you are generating the Word document on the fly, you will need to set the MIME type so that the browser knows that the response is a word document. I suggest the docx format for generating content.
If it is a Windows Application, this should work...
System.Diagnostics.Process.Start("FileName.doc");
For a web application, just redirect to the filename on the hosted server, or use one of the ways as described in the post below...
http://www.dotnetscraps.com/dotnetscraps/post/4-ways-to-send-a-PDF-file-to-the-IE-Client-in-ASPNET-20.aspx

Resources