How to serve files stored in FTP space - c#

My ASP.Net MVC application allows you to download files that are stored in a repository accessible via FTP.
I would need to implement the best strategy to serve these files to the client. I could implement a method that downloads the file from FTP and then serves the file through FileResult ... but clearly it does not seem the best way at all (especially in the case of large files the client should first wait for the application to download the file and then wait a second time for the time necessary for the download).
Any indication or help will be appreciated

If the web server can only access the files over FTP, then that's the way to go.
If the files are on a different server, your web server needs to download them from there (either entirely or streaming) before it can serve them to its HTTP clients.
Alternatively both servers could share the same file location, either by attaching the same (virtual) disk or through another network protocol such as NFDlS, SMB, ...

Related

A single threaded client/server in C# with file upload, download

So I'm creating a basic single threaded file server that supports 4 different operations, like upload, download, delete and rename.
I'm trying to implement local server, where client and server both uses different port to communicate. Client is able to browse local file and upload it to the server, and able to download file from server.
What I don't know is how to implement this browse function and how to upload/download file from the server. I can implement simple message passing program between client/server.

Bulk upload large number of files to Azure from local file system

What is the best way for an admin user of a website to upload 10,000+ images spread across 2,000 sub-directories?
I have a c# MVC .Net web app where 4 times a year the business need to replace 10,000+ images. They have them on a network share, there is 1 parent directory, and then around 2,000 sub-directories underneath, each housing multiple image files.
I know how to do write to BLOB storage, parallel Tasks, etc., but how can the app running on Azure navigate the client side local file storage to find all the files in the sub-directories to upload them?
You can run AzCopy tool on the local network where the local files are, and use the /S flag to copy the files in a subfolder: Upload all blobs in a folder
In my opinion, I suggest you could directly write a command-line code or exe for the client admin to upload file.
Since our web app have no permission to access client's resources.If you want your web app access the client resources, you need use special ways like Relay Hybrid Connections or VNET.
It also need the client admin to config the client machine to allow the azure web app access.
In my opinion, the most easily way you could write a exe(it will auto upload the file to azure storage using datamovement library) which will run by the scheduled job in the client-side.

Read files from client folder and upload to server - ASP.NET

What is the best way to get files from client folder (a folder that the client will choose the path) and upload to server?
Thanks.
You can't.
For privacy reasons, code from web sites running in a browser context is not allowed to enumerate files or directories on the client machine and send that information to a server. Imagine what would happen if it could!
You could possibly get around this limitation with some more complicated solution that includes a client side install (e.g. an ActiveX control) but this is simply not possible with ASP.NET alone.

Uploading Files to Two Web Front End Servers - how to consolidate into one location?

I have built a web application which uses two web front end servers, the Users are randomly directed to either one through the same URL. The web app has specific functionality to upload and download files. When a file is uploaded, it is stored on a specific directory on the server to which it is uploaded.
The issue is that when a User uploads a file to the folder on Server 1, any user trying to download that same file from Server 2 will not be able to as it only exists on the server where it was uploaded.
What's the best way of solving this? I've looking at:
- Using a SAN, problem here is I don't want to change or create a domain
- Writing a Windows Service, would prefer to avoid this if possible, I've not done it before but will give it a go if necessary
Thanks in advance!
Joe
Unless I'm missing something very obvious, all you need is a shared location. This could be a network share addressed through a UNC path, a folder on an FTP server, a database, anything at all, as long as it's
shared,
accessible from both web-servers
web-application service account has read/write permissions to it.
From your requirements a network share on a file server (perhaps 1 of the 2 web-servers, or the load-balancer, or (ideally) a new server entirely) would be the simplest method.

Serving Silverlight apps from the webserver

I am building my own web server and want to serve from it a Silverlight application. Is there anything else I have to do besides setting the mime type and pushing the application through the wire?
It probably makes no difference, but the web-server is in C# (the micro-edition).
No, silverlight is all run on the client, so unless you want to do some webservices or whatever, you needn't do anything other than set the mime-type.
It is really just like a separate file that you serve to the client, just like any image, script or css file.
If you are developing a single Silverlight application that you want to deliver then you need only serve the XAP.
However if you are not the application developer or you want to deliver multiple apps effeciently then your web server needs also to be able to deliver other files that may come along with these apps. For example the libraries may be be delivered as zip files and they may download external images and XML files. Still this is all likely to be simple static content you will not normally need to implement other services.
Note if you are hosting an app to be referenced by a HTML file served by some other server then you need to get your site to respond with appropriate XML when SL requests the clientaccesspolicy.xml file.

Categories