0

I have a task to do. I need to build a WCF service that allow a client to import a file inside a database using the server backend. In order to do this, i need to communicate to the server, the setting, the events needed to start and set the importation and most importantly the file to import. Now the problem is that these files can be extremely large (much bigger then 2gb), so it's not possible to send them via browser as they are. The only thing that comes into my mind is to split these files and send them one by one to the server.

I have also another requirement: i need to be 100% sure that this file are not corrupted, so i need to implement also a sort of policy for correction and possibly recover of the errors.

Do you know if there is a sort of API or dll that can help me to achieve my goals or is it better to write the code by myself? And in this case, which would be the optimal size of the packets?

Daniele Sartori
  • 1,674
  • 22
  • 38
  • You need chunking and checksums. Don't think that's in WCF out of the box. – CodeCaster Jul 14 '17 at 07:29
  • Possible duplicate of [How to handle large file uploads via WCF?](https://stackoverflow.com/questions/1935040/how-to-handle-large-file-uploads-via-wcf) – M0CH1R0N Jul 14 '17 at 07:29
  • @M0CH1R0N that's really only a small part of the entire story. – CodeCaster Jul 14 '17 at 07:30
  • @CodeCaster That's true, but it's certainly a start. Duplicate retracted. – M0CH1R0N Jul 14 '17 at 07:32
  • @M0CH1R0N my problem is not really the one presented in your link. I know how to send small files. What i need to know is if there is a dll that can help me to manage very large files – Daniele Sartori Jul 14 '17 at 07:45
  • What kind of frontend do you have? Angular/ASP.NET MVC/... – M0CH1R0N Jul 14 '17 at 07:55
  • @M0CH1R0N Angular, but it's still not developed. My duty is to study a solution to this problem and develop a prototype – Daniele Sartori Jul 14 '17 at 07:58
  • I can't find all the functions you ask for in one library. You'll have to piece it together yourself. As CodeCaster previously said you can implement a checksum to ensure the integrity of the file. Splitting up the files in parts is not necessary as you can see in the post in my first comment. – M0CH1R0N Jul 14 '17 at 08:20
  • @M0CH1R0N i'm not pretending to have everything in a single library. However, as stated in the microsoft documentation : "As mentioned earlier, enable streaming only for large messages (with text or binary content) if the data cannot be segmented, if the message must be delivered in a timely fashion, or if the data is not yet fully available when the transfer is initiated. " and also "...Because of these functional constraints, you can use only transport-level security options for streaming and you cannot turn on reliable sessions" . This is not suitable for me – Daniele Sartori Jul 14 '17 at 08:37
  • @CodeCaster Do you know if i need to develop an application to do the chunking or is it possible to do it directly using the browser? – Daniele Sartori Jul 14 '17 at 09:49
  • They do have chunking for WCF, but I'm not familiar with it. There's a number of articles on the web about it, including this blog off MSD - [WCF Chunking](https://blogs.msdn.microsoft.com/webapps/2012/09/06/wcf-chunking/). Note this is not part of the .NET framework but uses WCF Extensibility, as I understand it. – Tim Jul 14 '17 at 16:16

0 Answers0