I have a problem with:
href="file://"
Well I want to point a link in html to file, in browser if I write like
file:///K:/filename.pdf
It works to open a file, but if I point it to:
href="http://file:///K:/AmberCRO%20SOP/2011-07-05/SOP-SOP-3.0.pdf"
It doesn’t work. link is changed to:
file///K:/AmberCRO%20SOP/2011-07-05/SOP-SOP-3.0.pdf
The colon after file disappears. Any suggestions as to what to do?
The reason your URL is being rewritten to
file///K:/AmberCRO%20SOP/2011-07-05/SOP-SOP-3.0.pdfis because you specifiedhttp://file://The
http://at the beginning is the protocol being used, and your browser is stripping out the second colon (:) because it is invalid.Note
If you link to something like
The above represents a link to a file called
k:/yourfile.pdfon the k: drive on the machine on which you are viewing the URL.You can do this, for example the below creates a link to
C:\temp\test.pdfBy specifying file:// you are indicating that this is a local resource. This resource is NOT on the internet.
Most people do not have a K:/ drive.
But, if this is what you are trying to achieve, that’s fine, but this is not how a “typical” link on a web page works, and you shouldn’t being doing this unless everyone who is going to access your link has access to the (same?) K:/drive (this might be the case with a shared network drive).
You could try
Note that
http://file:///K:/AmberCRO%20SOP/2011-07-05/SOP-SOP-3.0.pdfis a malformed