part of web page loads at host - css

I hope you are going to understand what i want to accomplish...
I have local web server with web application on it and 10 hosts. Because of poor communication link with the server, I would like to know is it possible to store pictures and maybe some css scripts locally to host so that browser load it from local hard drive

This is no longer allowed due to security issues. This may be possible with a local web server though.
See: How to show local picture in web page?

Related

What role does a web sever play in hosting of single page applications

As per my understanding, when user visits a url of a SPA application, the whole application is downloaded including any static html,assets and javascript. Can someone please clarify what role does the host web server play from there on? If after download of all the assets, I turn off the web server the application does not work. But ideally, it should work because now all the code to create any views is with the client already in form of javascript files. Let's assume there are no API calls for data.
Yeah it will work
If the application is fully loaded in browser it will work even after you turned off or disconnect the web server
Web Server No Need after the client has downloaded all the assets

Test Flex/Facebook Application localy

I´m new in Flex.
I'm trying to develop a Web Application integrated with Facebook.
I´m using Flash Builder 4.5 and the Adobe Facebook SDK.
The problem is that to test the application I need to upload the files to my webserver to avoid the facebook error.
I guess this is because Facebook only allows to run the application inside the domain that informed at my app page on Facebook.
Someone knows how can I test the application locally?
Best, Flávio
One way to test your application is to create a copy of your app on Facebook (i.e. register a new application), but set it up to point to localhost (i.e. your local development server). This will let Facebook send all the login redirects back to your local webserver rather than your current 'live' website.
It would help if you install a localhost webserver on your machine so you can run code locally. This will allow you to test your files on your own machine rather than having to upload them every time.
Set up a local web server (I like Apache, but IIS will work). with a virtual server and give it the same domain name as your production server. Use a hosts file to point the domain back to your own server.
You can also use Charles to record the web traffic, then build mock services that will provide that information.

Remote hosted flex app

I have a flex app that is hosted on my server. It runs off an amfphp + mysql stack.
I have had inquiries from potential clients who want to "white label" the product. Part of this means that they would want it to appear that the app is running off their server. So their clients would login at www.theirsite.com instead of www.mysite.com.
I obviously dont want to give them the actual app...but are there ways of letting their server redirect to mine without the user actually knowing?
I don't have extensive experience with Flex, but I've worked a lot with Flash. Several ideas come to mind:
Create a wrapper: a SWF that loads your app. With the proper security settings, it should work. Check out this article on crossdomain.xml and the specs for Security.allowDomain()
You could simply embed the SWF from your site, similar to a YouTube video
If that is not satisfactory and your hosting services allow it, you can create a DNS A record or a DNS C record for a subdomain in there site, but you would support all the traffic that page has.
Probably the easiest way would be for them to alter their DNS record to make a CNAME entry (alias) that is a subdomain of theirsite.com:
yourapp.theirsite.com => www.mysite.com

How to implement a secured download system?

What's the best way to implement a download system?
It needs to be integrated with an asp.net application.
I need the following features:
Deliver files larger than 50mb
Only users authorized by an asp.net login page can download
Need to know if the user downloaded the whole file, or part of it
Once the file is downloaded or canceled, the same url will not be available again
It's something similar to rapidshare I believe, but integrated with an asp.net application.
What would you guys suggest?
thanks!
What if you hosted the files on a lighttpd server running modsecdownload, and used your asp.net app to generate the secure urls to the files on that server?
That approach should handle items 1,2 and 4.
Not sure how you could tell from the server side that the download was completed successfully, maybe have some logic that parses the server logs?
You could also use nginx and its X-Accel-Redirect feature. It's simple, and nginx is even more ridiculously fast and lightweight than lighttpd. A common setup at least in the Ruby and Python web world is to run nginx in front of lighttpd or Apache. nginx serves all static media and proxies dynamic request to the web server behind it.

SharePoint 2007 Remote File Access Denied CAS

I have code running in an ascx within PageLayout within SharePoint 2007 that accesses files on a remote server i.e. File.Create("\servername\sharename\folder\file.txt"). The code runs within a SharePoint web application that has CAS trust set to Full in the web.config. The File.Create throws the following exception:-
System.UnauthorizedAccessException
Access to the path '\\servername\sharename\folder\file.txt' is denied.
The share is shared to Everyone with Full Control and the NTFS permissions are set to Everyone with Full Control. The web application app pool is running under a domain account also with explicit permissions to access that resource (not that this should be needed).
I ran Process Monitor on the remote machine and no hits were being recorded on the server. This leads me to believe that it is an issue with the SharePoint Code Access Security settings. Like I've said above, the trust in the web.config is set to Full.
Is it possible that CAS is still blocking the remote access? Can anyone think of any other area to review?
Update
A bit more information...
I've tried making the app pool acct domain admin and the problem still occurs. When using the same method to access a drive on the local machine it works fine. Running the same code in SnippetCompiler outside of sharepoint using the app pool account works fine.
Hope this helps, let me know if you can think of any more avenues of investigation or tests I can try.
Update
Im not sure if this would affect the issue but the local server is running Windows Server 2003 and the remote server is running Windows 2000.
Update
I've just tried running the code through a web part and it works fine. The file structure I use in the project that is failing is as follows:-
wss
- VirtualDirectories
- SharePointWebApp
- ...sp web app files
- .
- .
- PageLayoutControls
- control.ascx
- .
- .
Then in IIS I have the following structure:-
IIS
- Websites
- SharePointWebApp (pointing to \wss\VirtualDirectories\SharePointWebApp)
- PageLayoutControls (virtual directory pointing to \wss\VirtualDirectories\PageLayoutControls)
Then within the PageLayouts I reference the controls using the following:-
<%# Register TagPrefix="TEST" TagName="MyControl" Src="~/PageLayoutControls/control.ascx" %>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<TEST:MyControl id="myControl" runat="server"/>
</asp:Content>Let me know if you need more info.
Update
The mystery deepens...
When I access the sharepoint site from Internet Explorer (6 or 7) on the SharePoint web front end server I do NOT get the exception.
When I access the sharepoint site from Mozilla Firefox from the SP web front end server I DO get the exception.
When I access the sharepoint site remotely from ANY browser I get the exception.
Also, it makes no difference what user I use to log on to the site, as long as they have permissions to access the sharepoint site.
Any thoughts?
Update
Hmm, I've now found that if I access the sharepoint site remotely and the sharepoint site tries to do a File.Create() locally (i.e. File.Create("C:\temp\abc.txt")) then it works. If I access the sharepoint site from the sharepoint box and do a File.Create() remotely (i.e. File.Create("\ServerName\ShareName\FolderName\file.txt")) then it works.
It only fails when I access the sharepoint site remotely and have the sharepoint site try to do a File.Create() remotely as well. Kind of a double hop problem. This makes me think it may be an NTLM / Kerberos issue.
Currently, we are running using NTLM authentication.
Has anyone else experienced this sort of issue?
Update
Yep, I'm pretty sure this is an NTLM issue not allowing a double hop. I just changed the authentication on the sharepoint site to use Basic Authentication and its worked. Changed it back to Integrated Authentication and it failed.
Now to decide whether to move the farm to use Kerberos or find another way around the issue. :-/
Update
Just giving SPSecurity.RunWithElevatedPrivileges a shot now. One thing though, is RunWithElevatedPrivileges meant to be used in this context? Previously, I've only used it to get access to lists and libraries within SharePoint rather than accessing a file access the network.
Any thoughts?
Update
Yep, SPSecurity.RunWithElevatedPrivileges resolves the issue. :-)
I wonder if this is the double-hop issue and that your code is trying to access the resource as the impersonated user, but that fails because NTLM will not impersonate to another server (Kerberos would).
Have you tried SPSecurity.RunWithElevatedPrivileges? That would remove the impersonation (RevertToSelf) and then maybe the application pool owner can just act as himself (herself?) whereas maybe it couldn't before.
Just a thought and should be pretty easy to try out.

Resources