Silverlight的FTP上传 [英] Silverlight Ftp Upload

查看:268
本文介绍了Silverlight的FTP上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图通过Silverlight应用程序通过ftp文件到服务器。哪里的位置上载服务器文件系统中的文件,存在该Web服务器的沙箱区域之外。在这种情况下,Web服务器根目录存在于C:\\测试\\ WWW \\,并上传的文件将存在的位置C:\\用户\\上传。在此之情况我不知道,如果HTTP POST将工作(不使用web服务器根目录)。我只需要上载由用户选择对可能的沙箱外部存在不同的位置中的文件。与Silverlight我在想套接字我的基础上有限的端口范围的Silverlight是4502-4532最后的选择。我能做到这一点使用Web客户端和HTTP POST?我可以通过Silverlight的或JavaScript FTP连接?

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

推荐答案

这是一个有趣的场景,因为它听起来像你正在做的这一切都在同一台机器(客户端和服务器)上。我回应含糊不清原来的问题,并会喜欢的其他数据,以帮助回答这个完全。

This is an interesting scenario, since it sounds like you are doing this all on the same machine (both client and server). I am responding to the vague original question, and would love additional data to help answer this completely.

FTP上传本身不Silverlight支持,但上载文件的概念是,通过数据的HTTP流

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

如果您想从客户机做一个HTTP上传到服务器:您可以使用的在Silverlight 2和3的OpenFileDialog控制来读取数据,然后使用Web客户端上传的。

If you want to do an HTTP upload from a client machine to the server: You can use the OpenFileDialog control in Silverlight 2 and 3 to read that data, then use WebClient to upload it.

如果你想要做的东西而下载你的web服务器可以发送到客户端机器,那么你需要使用Silverlight 3或更高版本,其特点是<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.controls.savefiledialog%28VS.95%29.aspx\"相对=nofollow> SaveFileDialog控制。

If you want to do a download from something your web server can send, to the client machine, then you'd need to use Silverlight 3 or newer, which features a SaveFileDialog control.

所有的Silverlight文件对话框要求用户启动的操作为他们的工作,功能和用户将需要为安全起见,选择文件名(S)。

All Silverlight file dialogs require a user-initiated action for them to work, function, and the user will need to select the file name(s) for security purposes.

希望这有助于!

这篇关于Silverlight的FTP上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆