Client side Silverlight 4 upload to ASP.Net all in VB 2010

Silverlight 4 upload VB 2010Last update 21/05/2012 : reasson minor bugfix in filereceiver.ashx fixed a problem uploading Docx or Xlsx files This project shows how to asynch upload a file with Silverlight 4 from client browser to a webserver it is all done in VB 2010 and Silve

VB.NET (2.9 MB)
 
 
 
 
 
4 Star
(2)
3,588 times
Add to favorites
5/21/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • How to upload large files
    10 Posts | Last post December 09, 2012
    • Can you please help me.
      
      How do you upload large files? I have removed the maxfilesize value from the parameters list and when I try to upload a 300 Mb upwards file, it just breaks in between. I have modified the settings in config file to allow gb files
      
      Your help would be much appreciated
    • The max upload size is  limited to the servers settings and capabilities
      
      So if you want to upload files of gigabytes in size you must have full control over the server AFAIK IIS has a memory pool limit of 2 GB 
      
      The config  settings are different per server ( IIS6 , IIS7 , IIS7.5 , Apache ? ) so what sort of server do you use ?
       
    • IIS 6 Running on Windows Server 2003. 
      
      Kindly note that when I try to upload a file of 300mb, I get a cross script error in the SetTbxStyle.
      
      Could this be a memory issue? If so is it possible to amend the code to write to a tmp file whilst receiving the chunks.
      
      
      
      
    • I also noted that for when this limit is reached 268435456 it breaks the system. Is there anyway to extend this limit?
    • Okay ..... just found and confirmed the limitation seems to be a memory  allocation problem " Net.ScatterGatherBuffers.AllocateMemoryChunk " , it bumps out with a out of memory exception .
      
      In my tests this happened at exactly 256 mb ,, looks like the webclient just doesn`t allow more as the 256 mb limit .
      
      guess i have to rewrite the upload engine with a more low levell request object . 
      
      What is the maximum file size you want to sent then i will use this size as a reference for the upload engine .
      
      
    • Hi Michel,
      
      Well the file size varies. It may reach a maximum of 4Gb. Do you think it is possible to basically, split the file as you did in chunks and then the chunks get appended to a temporary file at the server end. 
      
      In that scenario, the buffer overflow should not happen as long at the chunk size is not set to above 256mb.
      
      Same like when you are downloading from the net. Internet Explorer creates a tmp file to which it appends the downloaded chunks.
    • I was pretty bussy at work , but i am currently working on this issue i already made a new method to split large files ( control detects this automaticly )  , now i have to figure out a way to reassamble it on the other side :-|  for my test i currently use a 512 mb test file if this works i will try it with a MSDN ISO of 4,3 GB
    • Sorry but I just can`t get the large  file on the other side on a reliable way with the current control . I guess it is time for a new large file upload control . 
      
      If you don`t mind it will be written in VS 2012 and SL 5 
      
    • No worries mate.  SL5 and VS 2012 is okay with me. Thanks for your help
    • Hello , 
      
      As promissed here is it http://code.msdn.microsoft.com/Silverlight-5-file-upload-fd59abce
      
      It was tested on my home network( wireless N ) and on my home  broadband connection ( 3 MB up , 30 MB down )
      
      I have checked the file CRC`s with winrar and they were the same , i could also use the iso images and see the movies or data without problems . 
      
      At home i used a Windows 8 pro machine as server ( IIS 8 ) and as client a windows 7 ultimate notebook . 
      
      The part that took most time was testing the transfers , building this control i got a few new ideas that i will build in at a later stage. 
      
      Currently the new control is equal in posibilities as this one , but supports also unlimited file sizes and seems to  transfer them right . 
      
      hth 
      
      Michel 
  • How to download file from server to silverlight client
    1 Posts | Last post August 17, 2012
    • Can you please guide me? I want to download file from server to client..
      
      Thanks,
      Bhavesh
      thakkarbhav@hotmail.com
  • param - checkfiletypebinary multiple file types
    3 Posts | Last post February 04, 2012
    • I have two questions:
      
      1. I see what I need to do add additional file types how can I have multiple file types using the checkfiletypebinary param? If I've added wmv and wav file types enum value 7 and 8 how do I set the param to accept both binaries?
      
      2. I understand the CheckFileType function do you have the "StartsWith for other file types like wmv and wav? If not do you have a suggestion on where to find these values?
      
      thanks very much for the download. I think this is exactly what we've been looking for.
      
      Rick
    • Hello Rick , 
      
      I have just update the Silverlight upload control to version 1.0.0.2 
      it has now your requirments implemented , even better i used it as the second example for the control on the test page 
      
      note that wmv is hard to test for as it is actually a container instead of a "true" file format , so i downloaded some examples and looked what they had in common . 
      
      Michel 
    • Thanks Michael I will take a look at that upgrade. I also found a web site that lists file signatures it's a great help with your VB upload. If it's ok to link here the web site is: http://www.garykessler.net/library/file_sigs.html or search on Gary Kessler dot net or search on file signatures.
  • Uploaded File Lost when published to IIS 7.5
    1 Posts | Last post June 20, 2011
    • When running locally, using the VS ASP.NET Development Server, I had no problems.  I published to the server, and can't seem to upload anything over 10MB.  It doesn't error out, the server logs show no problems, the progress indicates it went through, the file just never shows up...
      
      ...On my system, I am able to upload as large a file as I want.  I changed the httpRuntime maxRequestLength to 2147482624...I'm still unable to get large files once it's published...I also verified that the web.config on the server matches the one in my project...