I have a simple html document locally on my computer that looks like this:
<!DOCTYPE html>
<html>
<h3>
Python Script that partially automates sending my work hours to my boss.
</h3>
download
</html>
In the folder containing this file, I have the automate_emails.zip. When I open this html locally on my computer clicking download works as expected- the .zip downloads. However, when I email the html document to myself, the download no longer works (I think?) because I am now opening the html document from the cloud where it no longer has access to the automate_emails.zip.
How do I fix this so the webpage will have access to the .zip file even when it is not opened locally? Do I need a hosting service for this?
You obviously need to host upload that document somewehere online.
The easiest way would be to host the website and upload the .zip file as well.
I'm trying to download a file from a link in an HTML file in an Android Studio
Scenario:
Press on "Download" to download an APK file:
Download
I tried with opening google or other pages - it works.
And yes, my link is correct :D
I want to display pdf file on web page with tag. It’s working well on normal directory and live server.
<object style="width:450px;height:380px" data="admissionform.pdf"></object>
Screenshot of Output in normal directory
But same file and same code when I replace it on localhost. The pdf file not displaying. The browser or download manager switching to download the pdf file.
Screenshot of Output in localhost
<object style="width:450px;height:380px" data="admissionform.pdf"></object>
Today I run my script on a localhost on a Linux desktop PC. And the pdf file is displaying well.
But still, Now I try to find out why my embed pdf with HTML object tag is not working in windows operating system
I am learning to code .asp and am trying to set up a local environment for me to test simple asp codes.
I have just installed IIS on my PC running windows 10.
My browser successfully loads "localhost"
I have pasted the following code with the filename of test.html into the inetpub/wwwroot ,
<!DOCTYPE html>
<html>
<body>
<%
Response.Write("Hello World!")
%>
</body>
</html>
Navigating to localhost/test.html works fine.
Now, I want to change the file extension from test.html to test.asp. After i had done this, my browser is not able to load localhost/test.asp at all. It shows the following error,
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I am expecting the webpage to display "Hello World!"
ASP is legacy ASP.NET. I believe what you want is to use ASP.NET therefore name your file:
test.aspx
I don't think you want to try technology from 18 years ago but if that were your case, you will need to activate this feature Windows 10. In order to do this you will have to go to Windows Components and features and enable this old feature here:
Hi I have crawled a website for offline view, but many pages are downloaded and saved as .asp and there are links that point to these pages. But when I open these html page that has .asp extension in Chrome browser, the chrome will download the page instead of rendering the page. Is there a way to set the chrome to render the page instead of downloading it ?
Thanks
Chromium uses the system mime-type for the local files. On Linux you can change it in the xdg-open configuration:
$ mkdir -p ~/.local/share/mime/packages
$ cd ~/.local/share/mime/packages
$ touch application-x-asp.xml
Then edit the ~/.local/share/mime/packages/application-x-asp.xml:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/html">
<comment>Active Server Page</comment>
<icon name="text-html"/>
<glob-deleteall/>
<glob pattern="*.asp"/>
</mime-type>
</mime-info>
to set up the mime-type to text/html. On te end you have to logout/-in again, or just run:
$ update-desktop-database ~/.local/share/applications
$ update-mime-database ~/.local/share/mime
When your browser opens a file it uses the MIME type to decide which action it should take, typically download or open in the bowser.
So, for example, it encounters a zip file it will open the file save dialogue box and allow you to save the file.
And, if for example, you request a .asp from your browser which is served from a web server the browser will use the MIME type to decide which action to take, which will be to display in the browser.
The MIME type will be sent within the http headers and this would not be sent to the browser when you open your off-line .asp pages.
So if you could change the MIME type to "text/html" for .asp it should open it in the browser.
Unfortunately, there does not seem to be an option for changing MIME type / actions in Chrome.
You can change these setting in Firefox within Tools > Options > Content > FileTypes > Manage..
There is a way to open local, .asp files as HTML in Firefox.
Find your Firefox profile folder. On Windows 7, I found it here:
C:\Users\user\AppData\Roaming\Mozilla\Firefox\Profiles\738xdie.default\mimeTypes.rdf
Then add these lines to mimeTypes.rdf
<RDF:Description RDF:about="urn:mimetype:text/html"
NC:fileExtensions="asp"
NC:description="ASP Pages"
NC:value="text/html"
NC:editable="true">
</RDF:Description>
Restart browser. Your local file will now render as HTML.
There may be a similar technique with Chrome.
I suppose you want to view downloaded pages directly, that is not via some local web-server. Then I'd suggest to change (or append) file extensions during download according to their reported content-types from response headers. Of course, this will require to adjust all links to changed filenames inside other files. The other approach could be to store content-type of each page in a meta-base, and using a local web-server to serve the files according to their actual types from the base, not file extensions.
I have two solutions for you. the first one is to open those files with firefox.. and that's it..
if you insist to open them with chrome. you have to change all files extension to html instead of asp. use some programs for renaming..
but the links will be broken between pages..
so you have to find the js file that all pages use add this code in it to fix the links
document.body.addEventListener('click',function(e){
if(e.target.nodeName=='A'){
e.preventDefault()
href=e.target.href.split('/')
href[href.length-1]=href[href.length-1].replace('.asp','.html')
href=href.join('/')
parent.location=href
}
})
})