Download Silverlight Ftp

I am working on trying an ftp file on a server through a silverlight application. Where the location for downloading the file in the server file system exists outside the sandbox area for the web server. In this case, the web server root exists in "C: \ test \ www \", and the location for downloading the file will exist in "C: \ User \ Uploads". In this scenerio, I'm not sure if the Http POST will work (doesn't use the web server root). I just need to upload the file selected by the user to another place that may exist outside the sandbox. With silverlight, I think sockets are my last option based on the limited port range for silverlight, which is 4502-4532. Can I do this using WebClient and Http POST? Can I connect ftp via silverlight or javascript?

+3
source share
4 answers

This is an interesting scenario, since it seems that you are doing all this on one computer (both on the client and on the server). I answer a vague original question and would like to receive additional data in order to fully answer this question.

FTP upload itself is not supported by Silverlight, but the concept of file upload is through an HTTP data stream.

If you want to download HTTP from the client machine to the server: you can use the OpenFileDialog control in Silverlight 2 and 3 to read this data, then use WebClient to download it.

-, - , Silverlight 3 , SaveFileDialog control.

Silverlight , , .

, !

+2

, ASP.NET, POST WebClient .ashx. "C:\User\Uploads".

0

While the ftp server is on the same host as the silverlight application, you can use sockets and encode your own ftp client, but this is not very difficult and there are many examples.

0
source

At the same time, call it Silverlight 5, Sockets have received an update: ClientAccessPolicy.xmlthe port range has been increased and enhanced trust mode is available in the browser.

So I created sharpLightFtp to enable rudimentary Ftp.

0
source

Source: https://habr.com/ru/post/1712610/


All Articles