We have a Excel sheet embeded in HTML page. And when a user clicks on it, it should get downloaded to his workstation. I had embeded the following code for this.
But when I click on the Excel sheet icon, it gives me the pop up window, with New_User_Checklist.zip option. Ideally what we should get is the pop up windows for the actual excel file New_User_Checklist.xlsx with options to open or save.
What is wrong with the code? Please suggest.
<li>
The checklist for the User Add
<a href="manuals/New_User_Checklist.xlsx"><img src="icons/XLS-File-icon.png"
border="0" hspace="10" /></a>
</li>
Thanx in adv.
According to some quick research, this issue may be browser specific, and I think it can be resolved by including a .htaccess file in your root directory (if you're running Apache). More information at this link.
According to one user there, you would need to add a line like this to your .htaccess file:
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
Related
I've named this file originally sweaty resume, but now have changed it, and its still showing up as sweaty resume. How do I change it?
<h1 id="resume" data-aos="zoom-in-down" data-aos-duration="750">Resume</h1>
<div id="resume-container">
<div data-aos="zoom-in-down" data-aos-duration="750" class="resume-inner-container">
<embed src="./Resume/Resume.pdf" width="80%" height="600px" value="Resume">
</div>
<a data-aos="zoom-in-down" data-aos-duration="750" href="Resume/Resume.pdf"
target="_blank" download>
Download
Me!</a>
</div>
I would see a glimpse of the Resume.pdf and then it would change back to sweaty resume, how would I go about this?
That's your PDF document's title and not the filename.
You have to change it in the editor where you created it (MS word for example: https://support.microsoft.com/en-us/office/view-or-change-the-properties-for-an-office-file-21d604c2-481e-4379-8e54-1dd4622c6b75)
Or you can use some tools to change the title in the document metadata, some of them are available online (just google "Edit PDF Metadata").
Before doing that, make sure that the file is not being cached, probably you renamed the file from its editor correctly and you are just seeing a cached version, so from your network tab see if the file is being fetched from the network and not being loaded from the cache. If it's the case do a hard-refresh Ctrl (Control) + Shift and click R or look it up for your browser/OS
I am compiling one chm file with set of html files. In one html file i am using iframe tag and viewing text file throught 'src' attribute. I am able to see the contents of text file inside iframe when opening that HTML file in a browser. But when viewing that file in a chm file i don't see text file content. It is showing 'This page can’t be displayed' error in iframe.
This is the tag i'm using:
<iframe src="./mytextfile.txt" style="width: 100%; height: 300px;border:none"></iframe>
Is there anything to add to view that file. Please help me.
As you can see - your problem is reproducible (here on a German Windows10 machine).
You must ensure that the text file is either in the same directory as the project (.hhp) file or in a subdirectory of that directory.
You also have to add the *.txt file extension or filename to the [FILES] list in the .hhp file, as this ensures that the text file will be compiled into the .chm file. Best way is to do this by a text editor like shown below:
Save the *.hhp file and compile all content to your *.chm file.
Done!
BTW - here are some hints to another problem may be targeted:
Microsoft introduced some security restrictions many years ago that disable functionality in HTML Help files that are accessed over a network, so what you're seeing is almost certainly by design. There are two possible solutions: move the help file to your local drive, or implement some changes in the Windows registry so that you can view the contents of remote help files.
Microsoft's summary of the problem: http://support.microsoft.com/kb/896054
You may try following workaround that lets you explicitly 'unblock' a CHM help file coming from a network drive or internet download. To do this:
Open Windows Explorer
Find your CHM file
Right click and select Propertie
Click the Unblock button on the General tab
For information on how to make the registry changes, see this page:
http://www.grainge.org/pages/authoring/chm_mspatch/896358.htm
Or more straightforwardly, use the free HHReg utility available from the page below to make the required changes.
http://www.ec-software.com/products_hhreg.html
When I reference a .pdf in my webpage, the file doesn't open when I click on the link. I referenced the .pdf with the full path and the file is in the www folder.
When I hover over the link online, I can see that the link is to my .pdf on file but it doesn't open.
What am I doing wrong?
Thanks (HTML newbie)
Edit 1 - reference:
Filename
Edit 2:
I tried the local links extension and it still isn't opening. I also tried <a href="http://www.example.com/myfile.pdf"> and I get a 403 Forbidden error.
Modern browsers block links to file:// URLs from pages that aren't themselves on a file:// URL, and in the same directory tree.
This is a security feature. There are workarounds that you can install locally so it works on one specific computer. See this Mozillazine article.
Sorry - I don't have the rep to comment. But it looks like your ref structure could be wrong.
Try something like:
<a href="http://www.example.com/myfile.pdf">
UPDATE: Hmmm?
Have you tried just:
<a href="myfile.pdf">
Also, I found this which (while not directly relevant) has some discussions and links that may assist: How to set height on PDF file when linked to from HTML?
^^ Ignore that - it really is more related to how the pdf opens.
FURTHER:
I am assuming the pdf file name has no spaces in it. I also assume you have a local pdf viewer.
So I had a look at a random website which had a pdf link as an example. When clicked, it opened the pdf in a new tab. I am on chrome.
You may be able to use that to figure out what is wrong.
Here is the page: http://www.staff.uwa.edu.au/procedures/communications/media/uwanews
Looking at the pdf for the first listed file, this was their link:
Issue-10-December-2014 [PDF File, 2.0 MB]
It looks like path should be enough, but you might want to add the target="_blank" to open in a new tab.
Maybe also see this, which shows that users set how a pdf is opened - perhaps the settings on your end need to be set up: How to open link to pdf file in new tab using html
Anyway, I wish you the best. Post your answer when figure it all out.
When I open a new tab in Firefox, I see a html file that used to be on my server and I thought was lost due to overwriting. It's nowhere in my home folder. How do I get hold of it? I'm hesitating to click it because it may refresh.
Right click on the page to open a menu and then click View Source Code.
Hover over it with your mouse and see if it shows a path, or try editing to find a path to it. If this doesn't work, the best thing to do would to try clicking it and see what happens.
Goto about:cache?device=disk
Find the link and click on it.
Copy the file at the path specified in "file on disk."
If the file is gzipped rename it to zip and then unzip it.
Voila, you have your file.
You could also try about:cache?device=memory … files there are not gzipped.
I have some PDF's sitting in a folder on my computer, is there a way to write a link to open them on to a webpage?
The main idea is when the site goes live the link will be used to download the pdfs from the folder, but obviously at a later stage the folder will be a temp folder on my website.
So at the moment i just want to open the pdfs from a link, and the final goal will be to have the links download them.
Can any one help me?
This is the file path to get to the pdf i want to link to.
C:\Users\Shaun\Documents\FormValue\CS1.pdf
How would i create the link?
If you want to have a link to a PDF, you just have to put the relative path to the file in the href attribute of an a tag. So let's say you had a folder called pdfs, with the file boom.pdf inside it, and folder called site sitting beside it, with the file site.html in it. Then all you'd have to do is put this link in the html file:
Link to a pdf
In most (all?) browsers now a days, that will open the PDF in a new tab. To download it you would right-click it and do the Save Link As thing. Just need to get the path in href right.
UPDATE
If you want to use the full path to the file, you need to prefix it with file://. Then you just put it in the href the same as with a regular link, ending up with something like:
Link to a pdf
This should work with your set up, but if the pdf and the html files are stored near each other, relative URLs are still a good option. A little bit of Google work should show you how to write those.
For each PDF just do what I talk about here.
<object height="950" data="sample-report.pdf" type="application/pdf" width="860">
<p>It appears you don't have a PDF plugin for this browser.
No biggie... you can <a href="sample-report.pdf">click here to
download the PDF file.</a>
</p>
</object>
It works with most browsers and it degrades nicely.
It sounds like youre asking if you can put a link on a web site to a PDF sitting on your computer. You can't. The files have to be either on another web site or on your site's server.
If you are using ASP.NET, you can have the link point to a handler that accepts a query string identifying the file, either by file name or a hash of the file. Then the handler can look in the folder for a file that matches the pattern, read the file as a byte array, and then write those bytes to HttpResponse.