add items programmatically

Last post 09-26-2009, 8:32 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  09-25-2009, 10:18 AM 55881

    add items programmatically

    Hi,
     
    I want to give my users the possibility to change the files they have uploaded at a later time. Therefore the control has to load the files allready uploaded by the user.

    I found this method for adding a item in code
     
      uploader.Items.Add(int fileSize, string fileName, Stream stream);
     
    but I can't seem to get the stream correct. 
    does anybody know how to get this line working? or another way to add them.
    thx.
     
     
      
     
     
     
  •  09-26-2009, 8:32 AM 55888 in reply to 55881

    Re: add items programmatically

    Hi,
     
    If you already has a file, you can use this to create a Stream object :
     
    using System.IO;
     
    Stream s=new FileStream(filepath,FileMode.Open,FileAccess.Read,FileShare.Read);
     
    For advanced usage, you can check the (in the downloaded zip file)
     
    Ajax-Uploader\AdvancedCS20-MicrosoftAjax\EditTopic.aspx
     
    Regards,
    Terry
View as RSS news feed in XML