Im hosting a couple of html files using an Azure website. I want to hide the .html file name extensions. I have been looking trough the site however i didnt find an options that works specifically with Azure websites.
You could use a URL Rewrite in the web.config file for an ASP.NET application to send a 404 or some other response for .html file requests.
Also, you could probably set up a custom HTTP handler mapping for .html extensions. That way a language processor could intercept those requests instead of just serving the file.
Related
I am confused with downloading files on Heroku. Where will the pdf file goes if I use Selenium and click the download button? Can I choose where the files to go?
If it can not work, is there any method that I can use?
I am using Python Selenium to browse pdf files on a website (because that website uses Javascript onclick method to download the file but not using href in "a" tag, so it is hard to use something like Beautifulsoup or Request to download it)
I hope this crawler program is always online, so I think I should put it on Paas such as Heroku.
When users make a request to it, it will go download files and return them.
I am trying to embed a dynamic (Elm) app that has it's own routing into a jekyll blog. I load the app by adding a page in subdirectory that loads html that includes the javascript file holding the app.
However, the app has certain links that when clicked navigate to a path /some/path/123, where 123 is an id. The app then makes a request to fetch the relevant data and displays it.
This is where I run into trouble because Jekyll intercepts these redirects and the server displays a Not Found Error because there is no page setup for that path. Does anyone know how I might get around this problem? Otherwise, I suppose I will server the app on a subdomain.
Jekyll isn't a server so it can't intercept any request, there is no page generated in the requested path (it just comes with a server for testing purposes).
Put Jekyll into a sub directory and serve the other app as usual.
My knowledge about Web technologies is very low and I just wanted to know if the following scenario would be possible with HTML5 and Javascript:
If I host an HTML file in Dropbox and send this link to seomeone, would it be possible that this HTML file creates a new file in my Dropbox? For exampe the HTML file is a form that one can fill out, can the HTML file create a text (.txt) file with the form content?
As far as I understand, the HTML file has to be hosted by a webserver and has to allow Javascript or PHP to achieve this. But maybe there is a way to just use an HTML file, a dropbox and a browser?
Any hints what topics I should study to achieve this goal?
On what I've understood from Dropbox, it does not directly show you the file contents in any manner. You can store files there, but the only thing you can see when opening a link that directs to the file, is the page which allows you to download the file to your own PC and save it.
This would seem like an impossible thing to achieve, in any cloud service like Dropbox it would seem. I would recommend you to just get the web hosting service, they are usually not that highly priced after all.
You could do this, but you shouldn't. To make this work, you'd have to use the Dropbox API to upload files, and you'd have to embed in your web page an access token for your account. That means anyone who looked at the source of your web page could get access to make changes in your account (e.g. delete all your files). So there's no safe way to do this without a server-side component (like PHP).
I'm new to creating chrome extensions. I want to test sending messages from a web page to an extension as described here: https://developer.chrome.com/extensions/messaging#external-webpage.
I'd like to just use an html file in my file system, like "file:///C:/Users/johng/Documents/TestExtensionCall.html", to do the initial testing but the developer documentation indicates that you need to include "externally_connectable" in your extension manifest to expose the messaging api and the url pattern must include a second-level domain.
Can an html file from the file system be used to test sending messages from a web page to a chrome extension? Do I actually need to use a web page from a web site to do the testing?
Thanks,
John
For testing externally_connectable, you have1 to use a web server.
Though, you can still use a local development web server. Normally, it would have a localhost hostname, but you can specify an alias for it in your DNS hosts file, say, my.localhost, and it would satisfy Chrome's requirements.
See here for more information about the hosts file.
1 To the best of my knowledge
I have a single page application that I am (trying) to host on Google Cloud Storage.
The application is at index.html, and the application handles routing using Angular's html5Mode. (e.g.: routes like example.com/this and example.com/that are handled by the js application in index.html)
Using Google Cloud Storage's website configuration this is all well and good, except that routes that are accessed directly ("example.com/this") will 404 as they obviously do not map to a file.
I have set my 404 page to be my index page, but what I really need in order to run a single page application in html5Mode is that such routes ("example.com/this") will not return a 404 header - they will simply be handled by index.html and return a success header (200).
Is this possible?
Setting index.html to your 404 page from the website configuration seems to do the trick now.
Unfortunately, this isn't really possible. Google Cloud Storage's web mapping is pretty simple, and you can't create arbitrary rules based on patterns and the like.
You might want to consider either disabling html5mode or forcing a hashbang with html5mode. See this answer for more on that option.