Silverlight Ftp Upload

前端 未结 4 661
名媛妹妹
名媛妹妹 2021-01-20 13:45

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

4条回答
  •  逝去的感伤
    2021-01-20 14:21

    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 uploading itself is not supported by Silverlight, but the concept of uploading a file is, through an HTTP stream of data.

    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.

    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.

    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.

    Hope this helps!

提交回复
热议问题