Richard Arnold

Richard Arnold

  • NA
  • 12
  • 16.9k

SaveFileDialog copies empty zipped file to destination

Dec 31 2012 8:49 PM
I have a toolStripDropDownButton on a menuStrip for importing files and saving them to different directories. In my calling code I pass a string filter for .pdf and .mp3.zip audio magazine files. I pass 2-parameters to a class, the filter and the magazine type.

I am using an OpenFileDialog for the user to select a source folder for various files. I then pass the filter to the OpenFileDialog.Filter and based on the string magazine type (magType) I  use a SaveFileDialog to save the file(s) to particular folder locations depending on the file type.

The code successfully copies the PDF file to its location. However, the method copies an empty zipped file (.mp3.zip) to the destination folder. The original is megabytes in size, the copied version displays 0KB in size.

NOTE: Whereas I allow the user to select the source file and location, depending on the dialog.Filter passed in, I want to copy the files to directories I have created using DirectoryInfo.

Please provide some suggestions on why the file is copied but is 0KB. The source code is attached. Thank you.

P.S. This question was answered via suggestions in the automated reply.