Can't upload files to URL if not is localhost - windows

I using windows. I have an issue when try to upload files if upload URL is not loopback IP because of my security system.
For example, I create a webserver on my local machine and I have a simple webpage like this
<body>
<input type="file" />
</body>
If I access it by loopback IP like localhost or 127.0.0.1 it works without a problem. But when I try with local IP of my machine (ex: 192.168.1.10), after FileDialog show up and I choise an file then click "OPEN", security system pop-up and block that action. This happen even I use the machine that server running on, to access webpage or in other PC on local network.
Have any way to using javascript to config some properties of FileDialog that be called to allow file choise. Or have any way to load file from drive to browser without using FileDialog then parse it to base64 for tranfer.
I have try many way like file drag and drop method but the file have loaded to the browser will be empty and I think is because of security system too.

Related

how to implement save as when downloading wav file to local machine in mvc

I would like to implement an option to let the user download or save a wav file to their local machine. I currently have this:
<div id="ContextMenu">
<a id="savebtn" class="savebtn" href="~/Content/audio/sounds.wav" download="sounds.wav">Save</a>
</div>
This seems to be working when I access the website from my machine but when another user accesses the site from their machine it only opens the media player but doesn't actually saves the wav file in their local machine. Does anyone know why it's doing this and how I can fix it? Also if possible, how can I implement a "save as" so the user has the option of choosing where to save the wav file.
Thank you
the actual behavior depends on the browser. I'd advice to use the Content-Disposition header (Uses of content-disposition in an HTTP response header)
Content-Disposition: attachment; filename="sounds.wav"
it is not part of the http standard, but it is widely implemented and tells the browser to save the content instead of handling it
next to that - in the href you should not use ~ (tilde in href), use relative or absolute url of the page , e.g. ./Content/audio/sounds.wav

Pre-Open Links in a Webpage using Firefox Addon SDK

I want to pre-open HTTPS connections (using a proxy) to every server that is linked in a Webpage, so that when a User clicks on a link the connection to the server has already been established.
Anybody got a hint how to achieve this with Firefox Addon SDK? I think I have to use a content script first to parse the Webpage for the links and then connect to every server using the '#mozilla.org/network/socket-transport-service' class?
use HTML5 rel="prefetch" or rel="preconnect" attribute on the link. IDK if this will work because the addon has to fire before the content is parsed as the DOM to take effect

How to load an entire HTML page from one website into another

I have been working on a website www.xyz.com which is hosted on some server. I have been loading forms & contents from www.abc.com using I Frame which is hosted on Azure. We have now decided not to use I Frames and to load the content from www.abc.com using Jquery AJAX. Now the abc.com is providing me the UI page fragment for my forms and contents from Azure blob storage in form of .html file or .txt file. If i try to do a normal AJAX call for the HTML or TXT file path, i can the see the content coming in the Response tab of that URL but the code does not enters the Success template and hence i am unable to modify or access the content.
Please suggest
You can use Application Request Routing (ARR) for this. This is a module you can install in IIS which also works in Windows Azure.
The following image illustrates how ARR works. An incoming request is intercepted and based on a set of rules the request is forwarded (for you this will be to xyz.com) and the response is the served back to the user. Even though this illustration explains the principle with sub directories, it can also be applied on the full site.

Page tab loads content from some domains but not others?

I’ve created a welcome tab for a Page. When I set the Page Tab URL to pull content from http://journalism.unr.edu/facebook/welcome/, the tab comes up blank. But when I uploaded a copy of the content to a free 000webhost.com hosting account at http://rsj.netii.net/welcome/, and used that address as the Page Tab URL, the content loads just fine. What I want to know is, why?
I’ve experimented with pulling content from other URLs into my page tab:
yahoo.com - works
google.com - doesn’t work
unr.edu - works
journalism.unr.edu - doesn’t work
unr.edu/engineering - doesn’t work (shows error message: “The page cannot be displayed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.”)
Does anyone know why page tabs/iframe apps load content from some domains but not others? Can anyone tell me how to fix the journalism.unr.edu web server (I have access to it, I work for the journalism school) so that page tabs can load content from it? We’d like to be able to pull content straight from our website without having to copy it over to a free hosting account.
I'm not sure what is the problem with http://journalism.unr.edu/facebook/welcome/
But I cannot even get it to load inside of an iframe. Maybe there's some restriction setup in the hosting or server that servers that site. Or maybe a more complex issue with the server not allowing it to be iframed from a different host domain.
Simple to test, just make an html page like.
<html>
<body>
<p>I hope it loads</p>
<iframe src="http://journalism.unr.edu/facebook/welcome/" width="400" height="300"></iframe>
</body>
</html>
Also: "unr.edu/engineering - doesn’t work (shows error message: “The page cannot be displayed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.”)"
That one is because you're pointing to a resource on the server that does not allow HTTP POSTs.

Internet Explorer does not load images cross domain (https)

this is an updated question:
I am trying to include a picture on an external server.
PROBLEM HERE: my home website is using https:// and the picture on the external server is just http. The picture is fine (tested) but IE seems not to allow to access http:// sources when on a https:// website.
I am looking for html or javascript code to allow access for loading pictures from other domain WHEN my home domain is HTTPS and my external domain is HTTP
thanks
Klaus
I'm afraid this is a feature of the browser. When you enter a page like this on IE and some other browsers, it will give the user the option to disallow "unsecured" elements on the page (this includes elements served over HTTP); and will not display them. Your page cannot override the users' action.

Resources