none
create text file using silverlight and make it available for download- vb help pls.. :)

    Question

  • hi,

    i need to know how to create a text file and make it be available for download on the server, like when a user types in a textbox and then clicks a button, the text which user just typed be transfered to a text file and user can download it.

    the problem is i think isolated storage doesnt do this right?  or am i just ignorant? :s


    eg: user goes here -  www.example.com/silverlightapp

    where s/he types in a text box and clicks a button, which creates a text file on -

    www.example.com/usertypedtext.txt

    vb help pls!!

    thanks in advance! :)


    Sunday, August 08, 2010 7:36 PM

Answers

  • What is your purpose? Do you just want the user to be able save the text they typed to a file on their own machine or you want this file to be saved on Server so it can be downloaded from anywhere later? 

    If your purpose is the 1st one, you do not need to save the file to server then have the user to download it. You can just open the SaveFileDialog when user click the Save button to save text to a file with user specified file name and location.

    If your purpose is to save the File to a central location so user can download from anywhere or other user can download it, then you can just send the text back to Server with a WCF service. In your WCF service, you can save the text to a File on server or some kind of file store.



    Sunday, August 08, 2010 9:05 PM
  • WCF is running on your Server, not on User's machine. So it doesn't matter if the user is on a PC/Mac or Phone. You just need to call WCF or any Web Service (if you are not using on IIS Web Server) form Silverlight to send the Text back.

    For user to download this file, you don't need WCF. Just provide a link point to the URL of this file on your page is enough.






    Monday, August 09, 2010 10:10 AM

All replies

  • What is your purpose? Do you just want the user to be able save the text they typed to a file on their own machine or you want this file to be saved on Server so it can be downloaded from anywhere later? 

    If your purpose is the 1st one, you do not need to save the file to server then have the user to download it. You can just open the SaveFileDialog when user click the Save button to save text to a file with user specified file name and location.

    If your purpose is to save the File to a central location so user can download from anywhere or other user can download it, then you can just send the text back to Server with a WCF service. In your WCF service, you can save the text to a File on server or some kind of file store.



    Sunday, August 08, 2010 9:05 PM
  • hey thanx for the reply :)


    i want to save it on central loacation so as to be downloaded by anyone from anywhere, the wcf service would work if the user uses a pc to view the page right? But my users would be accessing my site from mobile phones. will wcf work if users use mobile? isnt there another way to do this? thank u again! :)

    Sunday, August 08, 2010 11:51 PM
  • WCF is running on your Server, not on User's machine. So it doesn't matter if the user is on a PC/Mac or Phone. You just need to call WCF or any Web Service (if you are not using on IIS Web Server) form Silverlight to send the Text back.

    For user to download this file, you don't need WCF. Just provide a link point to the URL of this file on your page is enough.






    Monday, August 09, 2010 10:10 AM
  • my friend, you've just made my day! thats gr8! thank u, now i think i can manage.. :D  be well bro..

    Monday, August 09, 2010 11:28 AM