How to implement a secured download system? - asp.net

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.

Related

X-Accel-Redirect In Apache2

I'm building a Flask/Apache2 web app that includes large video files that a user must be authenticated to view. I'd like to use Flask to serve the video files after authentication and not having to expose the media directory instead of just the plain HTML video tag that anyone with the URL can access.
I've tried using flask's send_file which works for things like images and thumbnails but large videos take forever to buffer and freeze up.
I see that NGINX has X-Accel-Redirect for the redirection of video files on my server (hidden, not in the web directory) to go to the user through flask but I'm not that sure how to implement this with Apache2.
Running Flask, Apache2, Ubuntu
TLDR:
Basically trying to send large files to the user through flask (not using send_file as this freezes) to enable authentication and not having to expose the whole directory to the internet with the files as I would with the video HTML tag. NGINX has X-Accel-Redirect, what's the apache2 equivalent for use in flask?
Thanks!

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

ISAPI Rewrite With Azure Web App

I'm not sure if this is the best/correct place for this type of question. But I have an existing .NET website which I am moving from our dedicated EC2 server to an Azure Web App.
However, this current site uses an .htaccess file with about 200 redirects (301 from old urls to new ones) which is powered by ISAPI rewrite (Which was installed manually on the Win2008 server).
I need to keep these redirects, but wondering how everyone else deals with permanent Url redirects on .NET applications when moving to an Azure Web App (From a dedicated server that had ISAPI rewrite installed)?
Putting them all in the web.config seems a little odd to me? And I don't know how that would affect performance?
Any advice or pointers would be appreciated as always.
I always put them in the web.config.
If you think it will be too messy, you can put them in a separate file and use the configSource attribute to link to the file.

part of web page loads at host

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?

ASP redirect all incoming requests

Hi pardon my ignorance i'm coming from an apache background.
On IIS/ASP.NET (.NET 4.0) is it possible to redirect all incoming requests to a page for for maintenance and such. I tried just using a 404 redirect but it doesn't seem to cut it.
Thanks in advance
You may use an App_Offline.html file when you want to bring an ASP.NET site into maintenance mode:
The way app_offline.htm works is that you place this file in the root
of the application. When ASP.NET sees it, it will shut-down the
app-domain for the application (and not restart it for requests) and
instead send back the contents of the app_offline.htm file in response
to all new dynamic requests for the application. When you are done
updating the site, just delete the file and it will come back online.

Resources