Upload file to server silverlight 5


















Create context. Read buffer, 0, buffer. Result ; e. Close ; fileStream. OpenWriteAsync ub. FileStream fileStream, System. For that we need to reconfigure the things in configuration file Configure service behavior maximum number of items to serialize or deserialize. Leave a Reply Enter your comment here Fill in your details below or click an icon to log in:.

Email required Address never made public. Name required. Follow Following. Dhananjay Kumar Join 7, other followers. Controls namespace to open the select file dialog box. We have explicitly set the Multiselect property to false so that user will not be able to select multiple file to upload. Once user selects the file and click on Open button, ShowDialog method returns true else false. In case user has selected the file and clicked on Open button, we are. Framing the URI of the. Handled the OpenWriteCompleted event and using lamda expression defining the code that runs when this event fires.

In this code block we are reading the selected file in the stream and writing to the output stream. In code block you can see that we are creating array of bytes with size as that is the default maximum size of the file that can be uploaded. In case you want to allow bigger file, change the bytes array size. At last we are calling OpenWriteAsync method by passing the uri of the generic handler.

This method calls the generic handler because of Uri into OpenWriteAync method. Now create a generic hanlder UploadFile. Below is the code for my generic handler. QueryString[ "file" ];. In the above code snippet, we are first retrieving the file name being passed from the querystring.

Next we are using FileStream to create a file based on the file name being passed here note that we are also passing the folder name — UserData where our files gets uploaded, we must have write permission to this folder. Keep an eye on forth coming articles on Silverlight. In otherwords i want to copy this abc.

So we would suggest that you can try to implement this in asp. You can try to refer below sample code:. My requirement is achieving this using file upload control. In front end i have a fileupload control, where i can click browse then this file has to add to my project folder.

Because I believe he is trying to build a client app to run on his own computer, not expose it to the public and pull from remote client machine and push it to the server. Is this correct? If so then the only way to do it is to use the open file dialog as noted above. There is no other answer. This guy asks a simple question and you come back with your bs, your a joke. The content you requested has been removed.

Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:.



0コメント

  • 1000 / 1000